Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Dec 23, 2025

This PR converts cfg and cfg_trace attributes to the new parsed representation.

The primary challenge is that re-parsing these attributes in the HIR is a performance regression, since these attributes were only used in rustdoc and clippy parsing them in the HIR is extra work that was not done in the compiler before. To solve this, we only parse the attributes once and then store their parsed representation in the AST.

@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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 23, 2025
@JonathanBrouwer
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 23, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 23, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 23, 2025

☀️ Try build successful (CI)
Build commit: ed1fb29 (ed1fb2931c0b2ef01da69d775ed80af9ece506fe, parent: 0bd13c38df9a9a922bd8ec98ba7a8bc7e111860e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ed1fb29): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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.3% [0.2%, 0.7%] 6
Regressions ❌
(secondary)
0.3% [0.1%, 0.8%] 5
Improvements ✅
(primary)
-0.3% [-0.5%, -0.1%] 15
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 15
All ❌✅ (primary) -0.1% [-0.5%, 0.7%] 21

Max RSS (memory usage)

Results (primary -0.9%, 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.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
1.3% [1.2%, 1.3%] 2
Improvements ✅
(primary)
-1.4% [-2.4%, -0.9%] 3
Improvements ✅
(secondary)
-1.0% [-1.2%, -0.8%] 3
All ❌✅ (primary) -0.9% [-2.4%, 0.8%] 4

Cycles

Results (primary 2.8%, secondary 10.9%)

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

mean range count
Regressions ❌
(primary)
2.8% [2.3%, 3.3%] 2
Regressions ❌
(secondary)
10.9% [2.1%, 26.6%] 19
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.8% [2.3%, 3.3%] 2

Binary size

Results (primary -0.4%, secondary -0.2%)

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)
- - 0
Improvements ✅
(primary)
-0.4% [-1.9%, -0.0%] 78
Improvements ✅
(secondary)
-0.2% [-0.9%, -0.0%] 16
All ❌✅ (primary) -0.4% [-1.9%, -0.0%] 78

Bootstrap: 481.073s -> 480.532s (-0.11%)
Artifact size: 390.31 MiB -> 390.37 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 23, 2025
@JonathanBrouwer
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 24, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 24, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 24, 2025

☀️ Try build successful (CI)
Build commit: ffa4b1c (ffa4b1ccb2fcb0f68df82b45ec17492d21980eaa, parent: c4aa646f15e40bd3e64ddb5017b7b89b3646ac99)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ffa4b1c): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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.3% [0.1%, 0.7%] 8
Regressions ❌
(secondary)
0.2% [0.2%, 0.3%] 3
Improvements ✅
(primary)
-0.3% [-0.4%, -0.1%] 16
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.1%] 11
All ❌✅ (primary) -0.1% [-0.4%, 0.7%] 24

Max RSS (memory usage)

Results (primary -1.0%, secondary 0.6%)

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)
3.3% [3.3%, 3.3%] 1
Improvements ✅
(primary)
-1.0% [-1.1%, -0.9%] 3
Improvements ✅
(secondary)
-0.8% [-1.1%, -0.5%] 2
All ❌✅ (primary) -1.0% [-1.1%, -0.9%] 3

Cycles

Results (secondary 2.7%)

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)
2.7% [2.0%, 3.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.3%, secondary -0.2%)

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)
- - 0
Improvements ✅
(primary)
-0.3% [-1.8%, -0.0%] 94
Improvements ✅
(secondary)
-0.2% [-0.9%, -0.0%] 32
All ❌✅ (primary) -0.3% [-1.8%, -0.0%] 94

Bootstrap: 483.398s -> 483.821s (0.09%)
Artifact size: 392.47 MiB -> 392.44 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 24, 2025
@JonathanBrouwer
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 25, 2025
@GuillaumeGomez
Copy link
Member

I'll try to do a review in the next day or two. If this is blocking a lot, then I apologize and feel free to merge

No need to apologize, merge can wait for you. Enjoy you holidays. :)

@rustbot

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jan 5, 2026

☔ The latest upstream changes (presumably #150700) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 5, 2026

☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot
Copy link
Collaborator

rustbot commented Jan 6, 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.

@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 6, 2026

📌 Commit e9fdf11 has been approved by jdonszelmann

It is now in the queue for this repository.

@bors bors 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 Jan 6, 2026
@jdonszelmann
Copy link
Contributor

oh wait, perf, @bors rollup=never

@bors
Copy link
Collaborator

bors commented Jan 6, 2026

⌛ Testing commit e9fdf11 with merge d9617c8...

@bors
Copy link
Collaborator

bors commented Jan 7, 2026

☀️ Test successful - checks-actions
Approved by: jdonszelmann
Pushing d9617c8 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 7, 2026
@bors bors merged commit d9617c8 into rust-lang:main Jan 7, 2026
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 7, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 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 0aced20 (parent) -> d9617c8 (this PR)

Test differences

Show 40 test diffs

Stage 1

  • clean::cfg::tests::test_parse_err: pass -> [missing] (J0)
  • clean::cfg::tests::test_parse_ok: pass -> [missing] (J0)

Additionally, 38 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 d9617c8d9a55773a96b61ba3a4acb107d65615c1 --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. dist-x86_64-apple: 7910.9s -> 9476.2s (+19.8%)
  2. dist-aarch64-msvc: 5611.2s -> 6425.8s (+14.5%)
  3. dist-apple-various: 3928.1s -> 4440.4s (+13.0%)
  4. x86_64-gnu-tools: 3769.2s -> 3420.8s (-9.2%)
  5. dist-x86_64-freebsd: 4897.7s -> 5274.3s (+7.7%)
  6. test-various: 6945.1s -> 7450.5s (+7.3%)
  7. aarch64-msvc-1: 7606.5s -> 7085.0s (-6.9%)
  8. tidy: 173.0s -> 161.5s (-6.7%)
  9. aarch64-apple: 10588.5s -> 11268.6s (+6.4%)
  10. dist-ohos-x86_64: 4294.6s -> 4027.1s (-6.2%)
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
Collaborator

Finished benchmarking commit (d9617c8): 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.3% [0.2%, 0.6%] 5
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.3% [-0.4%, -0.1%] 13
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 11
All ❌✅ (primary) -0.1% [-0.4%, 0.6%] 18

Max RSS (memory usage)

Results (primary -0.2%, 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.8% [0.7%, 0.9%] 2
Regressions ❌
(secondary)
2.6% [1.4%, 5.0%] 3
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-1.3% [-2.9%, -0.8%] 6
All ❌✅ (primary) -0.2% [-2.0%, 0.9%] 3

Cycles

Results (secondary -1.8%)

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.3% [4.3%, 4.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-4.3%, -2.1%] 5
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.5%, secondary -0.2%)

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)
- - 0
Improvements ✅
(primary)
-0.5% [-1.7%, -0.0%] 48
Improvements ✅
(secondary)
-0.2% [-0.8%, -0.0%] 14
All ❌✅ (primary) -0.5% [-1.7%, -0.0%] 48

Bootstrap: 474.51s -> 474.542s (0.01%)
Artifact size: 390.85 MiB -> 390.84 MiB (-0.00%)

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  TOOLSTATE_PUBLISH: 1
  DEPLOY: 1
  IMAGE: dist-aarch64-linux
##[endgroup]
error: PRs changing the `nightly` channel should be sent to the `main` branch!
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"
echo "disk usage:"
df -h
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}

@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Jan 12, 2026
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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants