Skip to content

Port lint attributes to attribute parser#152369

Merged
rust-bors[bot] merged 11 commits intorust-lang:mainfrom
Bryntet:lint_attrs
Apr 3, 2026
Merged

Port lint attributes to attribute parser#152369
rust-bors[bot] merged 11 commits intorust-lang:mainfrom
Bryntet:lint_attrs

Conversation

@Bryntet
Copy link
Copy Markdown
Contributor

@Bryntet Bryntet commented Feb 9, 2026

View all comments

Tracking issue: #131229

Ports #[allow], #[deny], #[expect], #[forbid], and #[warn] to being parsed attrs

I tried my best to make this PR as small as possible, it was difficult. I hope it isn't too difficult to review

r? @JonathanBrouwer
r? @jdonszelmann

@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 Feb 9, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Feb 22, 2026
@Bryntet Bryntet changed the title lint attrs Port lint attributes to attribute parser Feb 22, 2026
@Bryntet Bryntet marked this pull request as ready for review February 22, 2026 18:57
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 22, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 22, 2026

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 22, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
Port lint attributes to attribute parser
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 22, 2026
@Bryntet Bryntet force-pushed the lint_attrs branch 2 times, most recently from e70b414 to d9434c9 Compare February 22, 2026 20:19
@Bryntet
Copy link
Copy Markdown
Contributor Author

Bryntet commented Apr 2, 2026

☀️ Try build successful (CI) Build commit: e567ff0 (e567ff0c7cac1f89c7e51b4b585edaca90228bea, parent: e6b64a2f4c696b840f8a384ec28690eed6a5d267)

nice that this was just flaky, and not an actual issue with the PR

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors retry

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 3, 2026

❗ You can only retry pull requests that are approved and have a previously failed auto build.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r=JonathanBrouwer,jdonszelmann

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 3, 2026

📌 Commit b375817 has been approved by JonathanBrouwer,jdonszelmann

It is now in the queue for this repository.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors p=0

@rust-bors

This comment has been minimized.

Bryntet and others added 11 commits April 3, 2026 11:08
also add attr_id to `Stable` variant directly, instead of having to
iterate over all the attrs on the hir_id to find it
…tr parser

also changes method `parse_limited_all` to take Iterator as an input,
to avoid needing to do expensive allocation
also removes E0452 and splits
`tests/rustdoc-ui/lints/renamed-lint-still-applies` into 2 tests

this is because of delayed warn lint being lost on compiler aborting on
error
also buffer any lints coming from pre-expansion, so that they are
emitted with proper lint level
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 3, 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.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r=JonathanBrouwer,jdonszelmann

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 3, 2026

📌 Commit ce7c492 has been approved by JonathanBrouwer,jdonszelmann

It is now in the queue for this repository.

@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 3, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer,jdonszelmann
Duration: 3h 37m 9s
Pushing 2972b5e to main...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing f908263 (parent) -> 2972b5e (this PR)

Test differences

Show 108 test diffs

Stage 1

  • [ui] tests/rustdoc-ui/lints/renamed-lint-still-applies-2.rs: [missing] -> pass (J1)
  • [ui] tests/ui/error-codes/E0452.rs: pass -> [missing] (J1)

Stage 2

  • [ui] tests/ui/error-codes/E0452.rs: pass -> [missing] (J0)
  • [ui] tests/rustdoc-ui/lints/renamed-lint-still-applies-2.rs: [missing] -> pass (J2)

Additionally, 104 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 2972b5e59f1c5529b6ba770437812fd83ab4ebd4 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. aarch64-apple: 2h 45m -> 3h 30m (+27.3%)
  2. dist-aarch64-llvm-mingw: 1h 28m -> 1h 48m (+22.9%)
  3. dist-apple-various: 1h 29m -> 1h 41m (+13.3%)
  4. pr-check-1: 30m 15s -> 33m 52s (+12.0%)
  5. x86_64-gnu-llvm-22-3: 1h 47m -> 1h 59m (+11.8%)
  6. dist-x86_64-apple: 1h 58m -> 2h 12m (+11.5%)
  7. dist-aarch64-apple: 1h 54m -> 1h 42m (-10.9%)
  8. x86_64-gnu-llvm-21-2: 1h 30m -> 1h 39m (+10.0%)
  9. dist-x86_64-llvm-mingw: 1h 54m -> 2h 3m (+8.6%)
  10. dist-i686-msvc: 2h 10m -> 2h 21m (+7.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (2972b5e): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 7
Improvements ✅
(primary)
-0.3% [-0.6%, -0.2%] 20
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.0%] 37
All ❌✅ (primary) -0.3% [-0.6%, 0.2%] 21

Max RSS (memory usage)

Results (primary -1.6%, secondary 2.9%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.7% [1.8%, 10.0%] 13
Improvements ✅
(primary)
-1.6% [-2.3%, -1.0%] 2
Improvements ✅
(secondary)
-3.0% [-8.3%, -1.1%] 4
All ❌✅ (primary) -1.6% [-2.3%, -1.0%] 2

Cycles

Results (primary 2.2%, secondary 3.6%)

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

mean range count
Regressions ❌
(primary)
2.2% [1.3%, 2.8%] 5
Regressions ❌
(secondary)
4.4% [3.3%, 5.5%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.3%] 1
All ❌✅ (primary) 2.2% [1.3%, 2.8%] 5

Binary size

Results (primary 0.0%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 4
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 4

Bootstrap: 491.353s -> 489.759s (-0.32%)
Artifact size: 395.11 MiB -> 395.08 MiB (-0.01%)

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Perf wins significantly outweigh the regressions
@rustbot label: +perf-regression-triaged

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. T-clippy Relevant to the Clippy team. 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.

7 participants