Use attribute name in message for "outer attr used as inner attr" errors#145792
Use attribute name in message for "outer attr used as inner attr" errors#145792bors merged 1 commit intorust-lang:masterfrom
Conversation
|
|
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
|
Discussed with @jdonszelmann: this does not work for the new attribute infrastructure. Ideally we want the each |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
d51a8c0 to
0238462
Compare
|
Some changes occurred in compiler/rustc_attr_parsing |
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
The force-push contains:
@rustbot review |
This comment has been minimized.
This comment has been minimized.
0238462 to
63d3dd8
Compare
63d3dd8 to
a8e9ca1
Compare
| pub(crate) struct OuterCrateLevelAttr { | ||
| #[subdiagnostic] | ||
| pub suggestion: OuterCrateLevelAttrSuggestion, | ||
| } | ||
|
|
||
| #[derive(Subdiagnostic)] | ||
| #[multipart_suggestion(passes_outer_crate_level_attr_suggestion, style = "verbose")] | ||
| pub(crate) struct OuterCrateLevelAttrSuggestion { | ||
| #[suggestion_part(code = "!")] | ||
| pub bang_position: Span, | ||
| } |
There was a problem hiding this comment.
i spent a long time trying to figure out how to make a correct subdiagnostic and i would not be surprised if this was massively suboptimal. reviewer, please double-check this bit :3
There was a problem hiding this comment.
I think it's alright, at least similar to ones I've made before.
|
@bors r+ rollup |
Rollup of 9 pull requests Successful merges: - #144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`) - #145790 (Improve dist for gnullvm hosts) - #145792 (Use attribute name in message for "outer attr used as inner attr" errors) - #145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags) - #145876 (Enable building/disting standard library in stage 0) - #145887 (bootstrap: Don't panic if codegen-backends is set to empty) - #145888 (platform-support: Fix LoongArch32 host column) - #145892 (add a flag to codegen fn attrs for foreign items) - #145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145792 - scrabsha:push-umpytyxunpxq, r=jdonszelmann Use attribute name in message for "outer attr used as inner attr" errors
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`) - rust-lang/rust#145790 (Improve dist for gnullvm hosts) - rust-lang/rust#145792 (Use attribute name in message for "outer attr used as inner attr" errors) - rust-lang/rust#145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags) - rust-lang/rust#145876 (Enable building/disting standard library in stage 0) - rust-lang/rust#145887 (bootstrap: Don't panic if codegen-backends is set to empty) - rust-lang/rust#145888 (platform-support: Fix LoongArch32 host column) - rust-lang/rust#145892 (add a flag to codegen fn attrs for foreign items) - rust-lang/rust#145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs) r? `@ghost` `@rustbot` modify labels: rollup
Port limit attributes to the new attribute parsing infrastructure Doesn't pass tests, to be rebased on rust-lang#145792 which will solve that r? `@fmease`
Port limit attributes to the new attribute parsing infrastructure Doesn't pass tests, to be rebased on rust-lang#145792 which will solve that r? ``@fmease``
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`) - rust-lang/rust#145790 (Improve dist for gnullvm hosts) - rust-lang/rust#145792 (Use attribute name in message for "outer attr used as inner attr" errors) - rust-lang/rust#145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags) - rust-lang/rust#145876 (Enable building/disting standard library in stage 0) - rust-lang/rust#145887 (bootstrap: Don't panic if codegen-backends is set to empty) - rust-lang/rust#145888 (platform-support: Fix LoongArch32 host column) - rust-lang/rust#145892 (add a flag to codegen fn attrs for foreign items) - rust-lang/rust#145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs) r? `@ghost` `@rustbot` modify labels: rollup
r? @jdonszelmann