about summary refs log tree commit diff
path: root/compiler/rustc_attr/src/builtin.rs
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-02-16Add feature gate for non_lifetime_bindersMichael Goulet-1/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-2/+2
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-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-1/+1
2022-09-05[Gardening] UPDATE - tidy fixesJhonny Bill Mena-1/+6
2022-09-05UPDATE - avoid exposing source_map methods from HandlerJhonny Bill Mena-1/+1
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-22Move `LitKind` logic to `session_diagnostics` moduleHampus Lidin-17/+6
2022-08-22Reorder diagnostics in code order, then alphabetical orderHampus Lidin-3/+0
2022-08-22Refactor remaining diagnosticsHampus Lidin-102/+63
2022-08-22Refactor additional diagnostics in `rustc_attr`Hampus Lidin-38/+18
2022-08-22Refactor more diagnostics in `rustc_attr`Hampus Lidin-48/+21
2022-08-22Refactor diagnostics in `handle_errors` functionHampus Lidin-31/+27
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-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
2022-07-07`UnsafeCell` now has no niches, ever.Oli Scherer-5/+3
2022-06-14Remove `rustc_deprecated` diagnosticsJacob Pratt-28/+1
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-2/+2
2022-05-24RFC3239: Implement compact `cfg(target(..))`Loïc BRANSTETT-0/+19
2022-05-24Clean up condition evaluation systemLoïc BRANSTETT-58/+64
2022-05-19Add and use stability helper methodsJacob Pratt-0/+20
This avoids an ambiguity (when reading) where `.level.is_stable()` is not immediately clear whether it is general stability or const stability.
2022-05-10only_local: always check for misuselcnr-138/+141
2022-04-14Use native duplicate attribute checkJacob Pratt-8/+0
2022-04-14Error on `#[rustc_deprecated]`Jacob Pratt-2/+22
2022-03-20Rollup merge of #94948 - jhpratt:rustc_deprecated, r=Dylan-DPCMatthias Krüger-5/+4
Fix diagnostics for `#![feature(deprecated_suggestion)]` Follow up from #94635, where I missed a couple things.
2022-03-18Rollup merge of #94295 - Urgau:cfg-always-eval-all-predicate, r=petrochenkovMatthias Krüger-2/+10
Always evaluate all cfg predicate in all() and any() This pull-request adjust the handling of the `all()` and `any()` to always evaluate every cfg predicate because not doing so result in accepting incorrect `cfg`: ```rust #[cfg(any(unix, foo::bar))] // Should error on foo::bar, but does not on unix platform (but does on non unix platform) fn foo1() {} #[cfg(all(foo, foo::bar))] // Should error on foo::bar, but does not fn foo2() {} #[cfg(all(foo::bar, foo))] // Correctly error on foo::bar fn foo3() {} #[cfg(any(foo::bar, foo))] // Correctly error on foo::bar fn foo4() {} ``` This pull-request take the side to directly turn it into a hard error instead of having a future incompatibility lint because the combination to get this incorrect behavior is unusual and highly probable that some code have this without noticing. A [search](https://cs.github.com/?scopeName=All+repos&scope=&q=lang%3Arust+%2Fany%5C%28%5Ba-zA-Z%5D%2C+%5Ba-zA-Z%5D%2B%3A%3A%5Ba-zA-Z%5D%2B%2F) on Github reveal no such instance nevertheless a Crater run should probably be done before merging this. This was discover in https://github.com/rust-lang/rust/pull/94175 when trying to lint on the second predicate. Also note that this seems to have being introduce with Rust 1.27.0: https://rust.godbolt.org/z/KnfqKv15f. r? `@petrochenkov`
2022-03-15Correct meta item diagnosticJacob Pratt-3/+3
2022-03-15Include tracking issue in diagnosticJacob Pratt-2/+1
2022-03-10Rollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwcoMatthias Krüger-11/+24
Merge `#[deprecated]` and `#[rustc_deprecated]` The first commit makes "reason" an alias for "note" in `#[rustc_deprecated]`, while still prohibiting it in `#[deprecated]`. The second commit changes "suggestion" to not just be a feature of `#[rustc_deprecated]`. This is placed behind the new `deprecated_suggestion` feature. This needs a tracking issue; let me know if this PR will be approved and I can create one. The third commit is what permits `#[deprecated]` to be used when `#![feature(staged_api)]` is enabled. This isn't yet used in stdlib (only tests), as it would require duplicating all deprecation attributes until a bootstrap occurs. I intend to submit a follow-up PR that replaces all uses and removes the remaining `#[rustc_deprecated]` code after the next bootstrap. `@rustbot` label +T-libs-api +C-feature-request +A-attributes +S-waiting-on-review
2022-03-09Permit `#[deprecated]` in stdlibJacob Pratt-3/+6
2022-03-09New `deprecated_suggestion` feature, use in testsJacob Pratt-5/+13
2022-03-05Improve unexpected_cfgs lint when their is no value expectedLoïc BRANSTETT-4/+3
2022-03-04Change `rustc_deprecated` to use `note`Jacob Pratt-3/+5
This keeps `reason` around for the time being. This is necessary to avoid breakage during the bootstrap process. This change, as a whole, brings `#[rustc_deprecated]` more in line with `#[deprecated]`.