about summary refs log tree commit diff
path: root/compiler/rustc_attr/src
AgeCommit message (Collapse)AuthorLines
2023-03-27Bless tidyMaybe Waffle-2/+2
2023-03-24Adjust documentation.Camille GILLOT-14/+18
2023-03-23Separate find_*_stability.Camille GILLOT-113/+93
2023-03-23Extract parse_stability and parse_unstability.Camille GILLOT-205/+224
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-4/+4
2023-03-11Simplify message pathsest31-1/+1
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-02-22errors: generate typed identifiers in each crateDavid Wood-9/+15
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-16Add feature gate for non_lifetime_bindersMichael Goulet-1/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-3/+3
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-06`rustc_attr` remove `ref` patternsMaybe Waffle-65/+69
...and some if-let-elses too :P
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-8/+6
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-28Rename `ast::Lit` as `ast::MetaItemLit`.Nicholas Nethercote-5/+7
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-2/+2
2022-10-23Migrate all diagnosticsNilstrieb-47/+43
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-21FIX - adopt new Diagnostic naming in newly migrated modulesJhonny Bill Mena-2/+1
FIX - ambiguous Diagnostic link in docs UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic [Gardening] FIX - formatting via `x fmt` FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way DELETE - unneeded allow attributes in Handler method FIX - broken test FIX - Rebase conflict UPDATE - rename residual _SessionDiagnostic and fix LintDiag link
2022-09-21UPDATE - rename SessionSubdiagnostic macro to SubdiagnosticJhonny Bill Mena-2/+2
Also renames: - sym::AddSubdiagnostic to sym:: Subdiagnostic - rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-30/+30
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-34/+34
2022-09-21UPDATE - move SessionDiagnostic from rustc_session to rustc_errorsJhonny Bill Mena-1/+1
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-14Also replace the placeholder for the stable_features lintest31-3/+7
2022-09-07Rollup merge of #101486 - asquared31415:invalid_repr_list, r=estebankYuki Okushi-12/+10
Add list of recognized repr attributes to the unrecognized repr error
2022-09-06add list of recognized repr attributes to the unrecognized repr errorasquared31415-12/+10
2022-09-05UPDATE - accept start_point and snippet instead of SourceMapJhonny Bill Mena-6/+6
2022-09-05[Gardening] UPDATE - tidy fixesJhonny Bill Mena-2/+7
2022-09-05UPDATE - avoid exposing source_map methods from HandlerJhonny Bill Mena-7/+6
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-7/+11
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-09-02Also replace the version placeholder in rustc_attrest31-0/+12
This fixes rustdoc not showing the current version as stabilization version for recently stabilized lang features.
2022-08-29Revert let_chains stabilizationNilstrieb-0/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-27use smaller span for suggestionsTakayuki Maeda-8/+6
2022-08-22Move `LitKind` logic to `session_diagnostics` moduleHampus Lidin-18/+22
2022-08-22Change to `diag` attributesHampus Lidin-29/+30
2022-08-22Reorder diagnostics in code order, then alphabetical orderHampus Lidin-113/+233
2022-08-22Refactor remaining diagnosticsHampus Lidin-102/+63
2022-08-22Refactor additional diagnostics in `rustc_attr`Hampus Lidin-38/+80
2022-08-22Add internal diagnistics lintsHampus Lidin-0/+2
2022-08-22Refactor more diagnostics in `rustc_attr`Hampus Lidin-48/+21
2022-08-22Refactor diagnostics in `handle_errors` functionHampus Lidin-31/+224
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-07-31Panic when checking an unknown stability attributeMaybe Waffle-1/+3
2022-07-26Implement `#[rustc_default_body_unstable]`Maybe Waffle-5/+26
This attribute allows to mark default body of a trait function as unstable. This means that implementing the trait without implementing the function will require enabling unstable feature. This is useful in conjunction with `#[rustc_must_implement_one_of]`, we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way -- making implementation of only `PartialEq::ne` unstable.
2022-07-21avoid embedding StabilityLevel::Unstable reason string into metadata ↵klensy-2/+33
multiple times
2022-07-20middle: add `implies_by` to `#[unstable]`David Wood-1/+27
If part of a feature is stabilized and a new feature is added for the remaining parts, then the `implied_by` attribute can be used to indicate which now-stable feature previously contained a item. If the now-stable feature is still active (if the user has only just updated rustc, for example) then there will not be an stability error for uses of the item from the implied feature. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-20attr: fix expected meta-item for `#[stable]`David Wood-1/+1
When an unexpected meta item is provided to `#[stable]`, the diagnostic lists "since" and "note" as expected meta-items, however the surrounding code actually expects "feature" and "since". Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-20attr/passes: comment -> doc commentDavid Wood-3/+16
Change some regular comments into documentation comments. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-14Auto merge of #95956 - yaahc:stable-in-unstable, r=cjgillotbors-2/+27
Support unstable moves via stable in unstable items part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of https://github.com/rust-lang/rust/pull/90328. The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge. This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.
2022-07-08fixes post rebaseJane Losare-Lusby-1/+1
2022-07-08add opt in attribute for stable-in-unstable itemsJane Lusby-2/+27