rustc_feature cleanups - #162051
Conversation
Rename it `BUILTIN_ATTRIBUTE_SET` because it's a set, and use `contains` instead of `get` where appropriate.
Also fix a typo and wrap some overlong comment lines.
It's more idiomatic.
Fix typos, wrap overlong lines, add missing comments, etc.
Avoid mixing it with `NonZeroU32`.
Every caller passes a predicate that just does a name comparison.
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_passes/src/check_attr.rs cc @jdonszelmann, @JonathanBrouwer
|
|
LLM disclosure: these changes were mostly identified by an LLM. I did all the code and text changes myself. |
| /// Notes to be displayed when an attempt is made to use the attribute without its feature gate. | ||
| /// Check function to be called during the `PostExpansionVisitor` pass, which will be one | ||
| /// of the `Features::*` functions | ||
| gate_check: GateFn, |
There was a problem hiding this comment.
FWIW this field only really exists to statically check that the feature actually exists - Features::doesnt_exist can't be found because that's not a feature.
You could remove this field if you can do that check in another way.
| [dependencies] | ||
| # tidy-alphabetical-start | ||
| rustc_data_structures = { path = "../rustc_data_structures" } | ||
| rustc_macros = { path = "../rustc_macros" } |
There was a problem hiding this comment.
This new dependency already existed transitively through rustc_data_structures so is fine :)
…, r=JonathanBrouwer `rustc_feature` cleanups Various cleanups. Details in individual commits. r? @JonathanBrouwer
…, r=JonathanBrouwer `rustc_feature` cleanups Various cleanups. Details in individual commits. r? @JonathanBrouwer
…, r=JonathanBrouwer `rustc_feature` cleanups Various cleanups. Details in individual commits. r? @JonathanBrouwer
…uwer Rollup of 12 pull requests Successful merges: - #162045 (`rust-analyzer` subtree update) - #162077 (compiler-builtins subtree update) - #137720 (support `#[target_feature(enable = ...)]` on `#[naked]` functions) - #160534 (stabilize smart pointer map functions) - #160551 (mir_build: Clearly distinguish or/refutable/irrefutable patterns during match lowering) - #161929 (explicitly track inherent const generic args kind) - #162063 (Switch dist-aarch64-linux to EC2 and update dist-x86_64-linux) - #161937 (A series of Polonius Alpha refactors) - #162014 (Move more `rustdoc-html` tests using `--test` into the right folder) - #162051 (`rustc_feature` cleanups) - #162055 (remove `_{style}` recovery for diagnostic structs) - #162075 (Move track_caller on closures gating to attribute parsing)
…, r=JonathanBrouwer `rustc_feature` cleanups Various cleanups. Details in individual commits. r? @JonathanBrouwer
…, r=JonathanBrouwer `rustc_feature` cleanups Various cleanups. Details in individual commits. r? @JonathanBrouwer
Various cleanups. Details in individual commits.
r? @JonathanBrouwer