Skip to content

Avoid delayed bug for disabled on_type_error arguments#158682

Open
TaKO8Ki wants to merge 2 commits into
rust-lang:mainfrom
TaKO8Ki:fix-158628-on-type-error-args
Open

Avoid delayed bug for disabled on_type_error arguments#158682
TaKO8Ki wants to merge 2 commits into
rust-lang:mainfrom
TaKO8Ki:fix-158628-on-type-error-args

Conversation

@TaKO8Ki

@TaKO8Ki TaKO8Ki commented Jul 2, 2026

Copy link
Copy Markdown
Member

Fixes #158628

This updates the disabled-feature path to call args.ignore_args(), matching the behavior of other diagnostic attributes.

example:

impl OnUnknownParser {
fn parse<'sess>(&mut self, cx: &mut AcceptContext<'_, 'sess>, args: &ArgParser, mode: Mode) {
if let Some(features) = cx.features
&& !features.diagnostic_on_unknown()
{
// `UnknownDiagnosticAttribute` is emitted in rustc_resolve/macros.rs
args.ignore_args();
return;
}

@rustbot

rustbot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to diagnostic attributes.

cc @mejrs

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 Jul 2, 2026
@rustbot

rustbot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

r? @camelid

rustbot has assigned @camelid.
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 73 candidates
  • Random selection from 15 candidates

@JonathanBrouwer JonathanBrouwer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 673dcf0 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

@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 Jul 2, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 2, 2026
…rgs, r=JonathanBrouwer

Avoid delayed bug for disabled on_type_error arguments

Fixes rust-lang#158628

This updates the disabled-feature path to call `args.ignore_args()`, matching the behavior of other diagnostic attributes.

example: https://github.com/rust-lang/rust/blob/c397dae808f70caebab1fc4e11b3edf7e59f58c7/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs#L13-L21
rust-bors Bot pushed a commit that referenced this pull request Jul 2, 2026
Rollup of 4 pull requests

Successful merges:

 - #155429 (Support `u128`/`i128` c-variadic arguments)
 - #158669 (Remove `src/tools/test-float-parse/Cargo.lock`)
 - #158674 (library: Polish transmute's `split_at_stdlib` example)
 - #158682 (Avoid delayed bug for disabled on_type_error arguments)
rust-bors Bot pushed a commit that referenced this pull request Jul 2, 2026
Rollup of 4 pull requests

Successful merges:

 - #155429 (Support `u128`/`i128` c-variadic arguments)
 - #158669 (Remove `src/tools/test-float-parse/Cargo.lock`)
 - #158674 (library: Polish transmute's `split_at_stdlib` example)
 - #158682 (Avoid delayed bug for disabled on_type_error arguments)
rust-bors Bot pushed a commit that referenced this pull request Jul 2, 2026
Rollup of 4 pull requests

Successful merges:

 - #155429 (Support `u128`/`i128` c-variadic arguments)
 - #158669 (Remove `src/tools/test-float-parse/Cargo.lock`)
 - #158674 (library: Polish transmute's `split_at_stdlib` example)
 - #158682 (Avoid delayed bug for disabled on_type_error arguments)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 2, 2026
…rgs, r=JonathanBrouwer

Avoid delayed bug for disabled on_type_error arguments

Fixes rust-lang#158628

This updates the disabled-feature path to call `args.ignore_args()`, matching the behavior of other diagnostic attributes.

example: https://github.com/rust-lang/rust/blob/c397dae808f70caebab1fc4e11b3edf7e59f58c7/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs#L13-L21
rust-bors Bot pushed a commit that referenced this pull request Jul 2, 2026
Rollup of 5 pull requests

Successful merges:

 - #155429 (Support `u128`/`i128` c-variadic arguments)
 - #158627 (Simplify option-iterator flattening in the compiler)
 - #158669 (Remove `src/tools/test-float-parse/Cargo.lock`)
 - #158674 (library: Polish transmute's `split_at_stdlib` example)
 - #158682 (Avoid delayed bug for disabled on_type_error arguments)
@camelid camelid assigned JonathanBrouwer and unassigned camelid Jul 2, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 2, 2026
…rgs, r=JonathanBrouwer

Avoid delayed bug for disabled on_type_error arguments

Fixes rust-lang#158628

This updates the disabled-feature path to call `args.ignore_args()`, matching the behavior of other diagnostic attributes.

example: https://github.com/rust-lang/rust/blob/c397dae808f70caebab1fc4e11b3edf7e59f58c7/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs#L13-L21
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]: attribute args were not properly checked

4 participants