Uh oh!
There was an error while loading. Please reload this page.
Fix ICE from cfg_attr_trace - #154803
Conversation
rustbot
commented
Apr 4, 2026
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 |
rustbot
commented
Apr 4, 2026
|
This comment has been minimized.
This comment has been minimized.
ed6f9af to
952c5baComparerustbot
commented
Apr 4, 2026
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?
Uh oh!
There was an error while loading. Please reload this page.
952c5ba to
46e2396Compare
This comment has been minimized.
This comment has been minimized.
46e2396 to
45b4e3cComparerustbot
commented
Apr 25, 2026
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 Fixesrust-lang#154801Fixesrust-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 Fixesrust-lang#154801Fixesrust-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 5 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) - #155769 (triagebot.toml: Ping Enselic when tests/debuginfo/basic-stepping.rs changes)
…uwer Rollup of 9 pull requests Successful merges: - #146181 (Add intrinsic for launch-sized workgroup memory on GPUs) - #154803 (Fix ICE from cfg_attr_trace ) - #155065 (Error on invalid macho section specifier) - #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`) - #155676 ( Reject implementing const Drop for types that are not const `Destruct` already) - #155696 (Add a higher-level API for parsing attributes) - #155769 (triagebot.toml: Ping Enselic when tests/debuginfo/basic-stepping.rs changes) - #155783 (Do not suggest internal cfg trace attributes)
Uh oh!
There was an error while loading. Please reload this page.
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.