Skip to content

Avoid delayed-bug ICE for malformed diagnostic attrs#152803

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
TaKO8Ki:fix-152744-diagnostic-attr-ice
Feb 19, 2026
Merged

Avoid delayed-bug ICE for malformed diagnostic attrs#152803
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
TaKO8Ki:fix-152744-diagnostic-attr-ice

Conversation

@TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Feb 18, 2026

Fixes #152744

Skip suggestions in expected_lit when parsing with Recovery::Forbidden, since this may later cancel InvalidMetaItem. This avoids creating delayed bugs that can be promoted to ICE.

@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 18, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2026

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 68 candidates
  • Random selection from 14 candidates

//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we also running this test with -Znext-solver?
That does not feel very relevant to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. It came from other ui tests. I will remove it.

Copy link
Contributor

@JonathanBrouwer JonathanBrouwer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me if you remove the revision with -Znext-solver

View changes since this review

remove -Znext-solver from ui tests
@TaKO8Ki TaKO8Ki force-pushed the fix-152744-diagnostic-attr-ice branch from 41d3c98 to 61c9af2 Compare February 18, 2026 16:43
@JonathanBrouwer
Copy link
Contributor

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 18, 2026

📌 Commit 61c9af2 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 18, 2026
…-ice, r=JonathanBrouwer

Avoid delayed-bug ICE for malformed diagnostic attrs

Fixes rust-lang#152744

Skip suggestions in `expected_lit` when parsing with `Recovery::Forbidden`, since this may later cancel `InvalidMetaItem`. This avoids creating delayed bugs that can be promoted to ICE.
rust-bors bot pushed a commit that referenced this pull request Feb 18, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #152799 (Subtree sync for rustc_codegen_cranelift)
 - #152569 (Stop using rustc_layout_scalar_valid_range_* in rustc)
 - #151059 (x86: support passing `u128`/`i128` to inline assembly)
 - #152097 (Suggest local variables for captured format args)
 - #152734 (Respect the `--ci` flag in more places in bootstrap)
 - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized)
 - #152173 (Reflection TypeKind::FnPtr)
 - #152564 (Remove unnecessary closure.)
 - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing))
 - #152658 (compiletest: normalize stderr before SVG rendering)
 - #152766 (std::r#try! - avoid link to nightly docs)
 - #152780 (Remove some clones in deriving)
 - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests])
 - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs)
 - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl)
 - #152793 (Do no add -no-pie on Windows)
 - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs)
 - #152806 (interpret: fix comment typo)
rust-bors bot pushed a commit that referenced this pull request Feb 19, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #152799 (Subtree sync for rustc_codegen_cranelift)
 - #152814 (stdarch subtree update)
 - #151059 (x86: support passing `u128`/`i128` to inline assembly)
 - #152097 (Suggest local variables for captured format args)
 - #152734 (Respect the `--ci` flag in more places in bootstrap)
 - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized)
 - #152173 (Reflection TypeKind::FnPtr)
 - #152564 (Remove unnecessary closure.)
 - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing))
 - #152658 (compiletest: normalize stderr before SVG rendering)
 - #152766 (std::r#try! - avoid link to nightly docs)
 - #152780 (Remove some clones in deriving)
 - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests])
 - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs)
 - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl)
 - #152793 (Do no add -no-pie on Windows)
 - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs)
 - #152806 (interpret: fix comment typo)
rust-bors bot pushed a commit that referenced this pull request Feb 19, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #152799 (Subtree sync for rustc_codegen_cranelift)
 - #152814 (stdarch subtree update)
 - #151059 (x86: support passing `u128`/`i128` to inline assembly)
 - #152097 (Suggest local variables for captured format args)
 - #152734 (Respect the `--ci` flag in more places in bootstrap)
 - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized)
 - #152173 (Reflection TypeKind::FnPtr)
 - #152564 (Remove unnecessary closure.)
 - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing))
 - #152658 (compiletest: normalize stderr before SVG rendering)
 - #152766 (std::r#try! - avoid link to nightly docs)
 - #152780 (Remove some clones in deriving)
 - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests])
 - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs)
 - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl)
 - #152793 (Do no add -no-pie on Windows)
 - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs)
 - #152806 (interpret: fix comment typo)
@rust-bors rust-bors bot merged commit 462a348 into rust-lang:main Feb 19, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 19, 2026
rust-timer added a commit that referenced this pull request Feb 19, 2026
Rollup merge of #152803 - TaKO8Ki:fix-152744-diagnostic-attr-ice, r=JonathanBrouwer

Avoid delayed-bug ICE for malformed diagnostic attrs

Fixes #152744

Skip suggestions in `expected_lit` when parsing with `Recovery::Forbidden`, since this may later cancel `InvalidMetaItem`. This avoids creating delayed bugs that can be promoted to ICE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: internal compiler error: expected expression, found <eof>

4 participants

Comments