Skip to content

Don't emit diagnostics during early lint attribute parsing - #164898

Draft
JonathanBrouwer wants to merge 3 commits into
rust-lang:mainfrom
JonathanBrouwer:silence-early-lint
Draft

JonathanBrouwer wants to merge 3 commits into
rust-lang:mainfrom
JonathanBrouwer:silence-early-lint

Conversation

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

This is work in progress, the code is quite ugly and I want to still improve it...
cc @mejrs so you know this PR exists

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 25, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 25, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
Don't emit diagnostics during early lint attribute parsing
ShouldEmit::Nothing => diag.delay_as_bug(),
ShouldEmit::NothingNoBug => {
diag.cancel();
ErrorGuaranteed::unchecked_error_guaranteed()

@JonathanBrouwer JonathanBrouwer Oct 25, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TODO: this is a crime

View changes since the review

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking tracing-log v0.2.0
[RUSTC-TIMING] rustc_hir_analysis test:false 5.768
[RUSTC-TIMING] tracing_log test:false 0.079
    Checking tracing-tree v0.4.1
warning: use of deprecated associated function `rustc_span::ErrorGuaranteed::unchecked_error_guaranteed`: should only be used in `DiagCtxtInner::emit_diagnostic`
   --> compiler/rustc_attr_parsing/src/context.rs:938:34
    |
938 |                 ErrorGuaranteed::unchecked_error_guaranteed()
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |

@JonathanBrouwer JonathanBrouwer added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Oct 25, 2026
@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9509e76 (9509e763f32f4738ee0877b99b28a3f18d47d7e7)
Base parent: dc44e7f (dc44e7f2c436b6041742e138b9c2176f093196d5)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9509e76): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@bors rollup=iffy rustc-perf
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 3

Max RSS (memory usage)

Results (primary 0.3%, secondary -0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.2% [0.5%, 1.9%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-0.6%, -0.4%] 5
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.8%] 1
All ❌✅ (primary) 0.3% [-0.6%, 1.9%] 9

Cycles

Results (primary 0.4%, secondary 0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.4%, 1.5%] 11
Regressions ❌
(secondary)
0.7% [0.4%, 1.5%] 6
Improvements ✅
(primary)
-0.5% [-0.5%, -0.4%] 5
Improvements ✅
(secondary)
-0.7% [-0.7%, -0.7%] 1
All ❌✅ (primary) 0.4% [-0.5%, 1.5%] 16

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 487.351s -> 487.992s (0.13%)
Artifact size: 405.87 MiB -> 405.97 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants