Skip to content

Tidy-sort and use more of GeneratedAttr - #166249

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
JonathanBrouwer:attr-word
Nov 23, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
JonathanBrouwer:attr-word

Conversation

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Can be reviewed commit by commit, every commit passes tests

r? @mejrs (or someone else)

@rustbot

rustbot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

@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 Nov 20, 2026
@JonathanBrouwer JonathanBrouwer changed the title Improve and use more of GeneratedAttr Tidy-sort and use more of GeneratedAttr Nov 20, 2026
@@ -3483,100 +3483,132 @@ pub enum AttrKind {
/// means it can only be added to items that cannot later be observed by other macros.
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
pub enum GeneratedAttr {

@JonathanBrouwer JonathanBrouwer Nov 20, 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.

I would love if we could find a way to use rustc_attr_ir::AttributeKind here rather than having to build a mirror enum here

View changes since the review

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Changes to the size of AST and/or HIR nodes.

cc @nnethercote

@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 Nov 20, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 20, 2026
Tidy-sort and use more of `GeneratedAttr`
@rust-bors

rust-bors Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 818ca3a (818ca3ac2376f6e7fb8cd275afb62e7594444a77)
Base parent: ec65cd5 (ec65cd52bba13d491ff65c9d218b39753755c84a)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (818ca3a): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never 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.9% [0.9%, 0.9%] 6
Improvements ✅
(primary)
-0.9% [-1.0%, -0.9%] 4
Improvements ✅
(secondary)
-0.4% [-0.8%, -0.0%] 25
All ❌✅ (primary) -0.9% [-1.0%, -0.9%] 4

Max RSS (memory usage)

Results (primary 1.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)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
1.9% [0.4%, 6.8%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.3% [-6.5%, -2.0%] 6
All ❌✅ (primary) 1.4% [1.4%, 1.4%] 1

Cycles

Results (secondary 0.1%)

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)
1.0% [0.8%, 1.1%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-2.1%, -0.9%] 3
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 459.547s -> 461.748s (0.48%)
Artifact size: 405.37 MiB -> 405.47 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 20, 2026
@JonathanBrouwer

JonathanBrouwer commented Nov 20, 2026 •

Copy link
Copy Markdown
Member Author

This improves performance significantly for small crates.
I think next-solver-stress is probably noise, I wouldn't see how this PR could regress perf on that

@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@mejrs mejrs left a comment •

Copy link
Copy Markdown
Member

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 Nov 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c5c50c6 has been approved by mejrs

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 Nov 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Rollup of 4 pull requests

Successful merges:

 - #166270 (Output type refactors & change analysis query into required_analysis)
 - #165302 (Introduce `rustc-unicode` crate for centralising Unicode version management)
 - #166249 (Tidy-sort and use more of `GeneratedAttr`)
 - #166370 (Disallow duplicates of `rustc_const_stable_indirect` and `allow_internal_unsafe` attributes)
@rust-bors
rust-bors Bot merged commit 4eaf280 into rust-lang:main Nov 23, 2026
15 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Rollup merge of #166249 - JonathanBrouwer:attr-word, r=mejrs

Tidy-sort and use more of `GeneratedAttr`

Can be reviewed commit by commit, every commit passes tests

r? @mejrs (or someone else)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Nov 23, 2026
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#166270 (Output type refactors & change analysis query into required_analysis)
 - rust-lang/rust#165302 (Introduce `rustc-unicode` crate for centralising Unicode version management)
 - rust-lang/rust#166249 (Tidy-sort and use more of `GeneratedAttr`)
 - rust-lang/rust#166370 (Disallow duplicates of `rustc_const_stable_indirect` and `allow_internal_unsafe` attributes)
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Nov 24, 2026
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#166270 (Output type refactors & change analysis query into required_analysis)
 - rust-lang/rust#165302 (Introduce `rustc-unicode` crate for centralising Unicode version management)
 - rust-lang/rust#166249 (Tidy-sort and use more of `GeneratedAttr`)
 - rust-lang/rust#166370 (Disallow duplicates of `rustc_const_stable_indirect` and `allow_internal_unsafe` attributes)
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 24, 2026
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#166270 (Output type refactors & change analysis query into required_analysis)
 - rust-lang/rust#165302 (Introduce `rustc-unicode` crate for centralising Unicode version management)
 - rust-lang/rust#166249 (Tidy-sort and use more of `GeneratedAttr`)
 - rust-lang/rust#166370 (Disallow duplicates of `rustc_const_stable_indirect` and `allow_internal_unsafe` attributes)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Nov 26, 2026
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#166270 (Output type refactors & change analysis query into required_analysis)
 - rust-lang/rust#165302 (Introduce `rustc-unicode` crate for centralising Unicode version management)
 - rust-lang/rust#166249 (Tidy-sort and use more of `GeneratedAttr`)
 - rust-lang/rust#166370 (Disallow duplicates of `rustc_const_stable_indirect` and `allow_internal_unsafe` attributes)
mehmettoplu-rs pushed a commit to mehmettoplu-rs/rustc_codegen_gcc that referenced this pull request Nov 27, 2026
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#166270 (Output type refactors & change analysis query into required_analysis)
 - rust-lang/rust#165302 (Introduce `rustc-unicode` crate for centralising Unicode version management)
 - rust-lang/rust#166249 (Tidy-sort and use more of `GeneratedAttr`)
 - rust-lang/rust#166370 (Disallow duplicates of `rustc_const_stable_indirect` and `allow_internal_unsafe` attributes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) perf-regression Performance regression. 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.

5 participants