Conversation
|
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 Some changes occurred in compiler/rustc_hir/src/attrs |
|
|
This comment has been minimized.
This comment has been minimized.
ed6f9af to
952c5ba
Compare
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
|
||
| /// Represents the trace attribute of `#[cfg_attr]` | ||
| CfgAttrTrace, | ||
| CfgAttrTrace(Span), |
There was a problem hiding this comment.
How does this behave with multiple cfg_attr attributes? Since this attribute can exist multiple times, ideally we should have a ThinVec<Span> here?
952c5ba to
46e2396
Compare
This comment has been minimized.
This comment has been minimized.
46e2396 to
45b4e3c
Compare
|
This PR was rebased onto a different main 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. |
There was a problem hiding this comment.
@bors r+ rollup
While the is_prefix_attr_for_suggestions is far from correct, this solution is better than ICE'ing and it's only for diagnostics anyways, so doesn't need to be perfect
…ttr-span, r=JonathanBrouwer Fix ICE from cfg_attr_trace Fixes rust-lang#154801 Fixes rust-lang#143094 r? @JonathanBrouwer The root cause is we recovery from parsing attribute error here: https://github.com/rust-lang/rust/blob/ed6f9af7d47f5a5eda2a4a1925d1e250b51a37f2/compiler/rustc_attr_parsing/src/parser.rs#L550 while the later suggestion code from type checking try to inspect the attr span of the `expr` in the second error, keep the span seems reasonable.
…uwer Rollup of 6 pull requests Successful merges: - #154803 (Fix ICE from cfg_attr_trace ) - #155485 (Add an edge-case test for `--remap-path-prefix` for `rustc` & `rustdoc`) - #155659 (cleanup, restructure and merge `tests/ui/deriving` into `tests/ui/derives`) - #155696 (Add a higher-level API for parsing attributes) - #155734 (Lint doc comments in cfg_select branches) - #155769 (triagebot.toml: Ping Enselic when tests/debuginfo/basic-stepping.rs changes)
…ttr-span, r=JonathanBrouwer Fix ICE from cfg_attr_trace Fixes rust-lang#154801 Fixes rust-lang#143094 r? @JonathanBrouwer The root cause is we recovery from parsing attribute error here: https://github.com/rust-lang/rust/blob/ed6f9af7d47f5a5eda2a4a1925d1e250b51a37f2/compiler/rustc_attr_parsing/src/parser.rs#L550 while the later suggestion code from type checking try to inspect the attr span of the `expr` in the second error, keep the span seems reasonable.
Fixes #154801
Fixes #143094
r? @JonathanBrouwer
The root cause is we recovery from parsing attribute error here:
rust/compiler/rustc_attr_parsing/src/parser.rs
Line 550 in ed6f9af
while the later suggestion code from type checking try to inspect the attr span of the
exprin the second error, keep the span seems reasonable.