Skip to content

even more cleanups for rustc_builtin_macros - #162925

Merged
rust-bors[bot] merged 9 commits into
rust-lang:mainfrom
cyrgani:builtin-macros-4
Sep 20, 2026
Merged

rust-bors[bot] merged 9 commits into
rust-lang:mainfrom
cyrgani:builtin-macros-4

Conversation

@cyrgani

@cyrgani cyrgani commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

View all comments

Followup to #162234 with more cleanups and perf improvements.

@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Changes to the code generated for builtin derived traits.

cc @nnethercote

@rustbot rustbot added 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 Sep 17, 2026
@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
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 77 candidates
  • Random selection from 21 candidates

@@ -2,15 +2,15 @@ macro-stats ====================================================================
macro-stats MACRO EXPANSION STATS: macro_stats
macro-stats Macro Name Uses Lines Avg Lines Bytes Avg Bytes
macro-stats -----------------------------------------------------------------------------------
macro-stats #[derive(Clone)] 8 67 8.4 1_879 234.9
macro-stats #[derive(Clone)] 8 67 8.4 1_895 236.9

@cyrgani cyrgani Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this test shows a slight increase in size, but that is only because the types in the test all have one-or-two-letter names

View changes since the review

@clarfonthey

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
even more cleanups for `rustc_builtin_macros`
@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 34797f1 (34797f1780452184438a4934a50dd0fbab5bb644)
Base parent: 76af58f (76af58f665c5cd76672e64ca118efbb0101fb224)

@rust-timer

This comment has been minimized.

@nnethercote

Copy link
Copy Markdown
Contributor

@cyrgani: The rustc_builtin_macros code has always been hard to navigate, so it's cool that you are making it better :)

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (34797f1): comparison URL.

Overall result: ✅ improvements - no action needed

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.

@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
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 3
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.2%] 9
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 3

Max RSS (memory usage)

Results (primary 3.9%, secondary -4.2%)

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

mean range count
Regressions ❌
(primary)
15.2% [15.2%, 15.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.7% [-2.9%, -0.6%] 2
Improvements ✅
(secondary)
-4.2% [-4.7%, -3.6%] 2
All ❌✅ (primary) 3.9% [-2.9%, 15.2%] 3

Cycles

Results (primary 1.7%, secondary 22.4%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
22.4% [9.9%, 35.8%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.7% [1.7%, 1.7%] 1

Binary size

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

Bootstrap: 498.345s -> 497.629s (-0.14%)
Artifact size: 408.96 MiB -> 408.89 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 18, 2026
@nnethercote nnethercote assigned nnethercote and unassigned mati865 Sep 19, 2026

@nnethercote nnethercote 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.

Mostly looks good. Changing the return types to Self is particularly nice.

I'm not convinced that the "remove PathKind, use ast::Path for all local paths directly" commit is an improvement. What's the rationale? I see it removes the PathKind enum, but now some paths go via Path and some via AstTy, which is a bit confusing.

View changes since this review

});
let nonself_args =
nonself_arg_tys.into_iter().map(|(name, ty)| cx.param(span, name, ty));
let mut nonself_args = Vec::new();

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.

Instead of a Vec that is pushed onto, nonself_args could be an iter + map.

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.

I think that would avoid the need for the "construct args directly" commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, this is now part of the "stop passing nonself_arg_tys around" commit.

@cyrgani

cyrgani commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

The motivation for removing PathKind etc. is that I want to remove this local version of Path entirely and just use ast::Path everywhere. But it probably makes more sense to do all those changes in the same PR, so I'll remove most of that commit for now.

@nnethercote

Copy link
Copy Markdown
Contributor

Thanks!

@bors r+

@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 072a61a has been approved by nnethercote

It is now in the queue for this repository.

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

Reason for tree closure: GitHub outage

@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 Sep 19, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
even more cleanups for `rustc_builtin_macros`

Followup to #162234 with more cleanups and perf improvements.
@jhpratt

jhpratt commented Sep 20, 2026

Copy link
Copy Markdown
Member

stalled

@bors yield

@bors try jobs=test-x86_64-gnu-parallel-frontend

@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #163043.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
even more cleanups for `rustc_builtin_macros`


try-job: test-x86_64-gnu-parallel-frontend
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
even more cleanups for `rustc_builtin_macros`

Followup to #162234 with more cleanups and perf improvements.
@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: dd284bd (dd284bd5a6314d55a02debd1652ee6aadffb2997)
Base parent: feaadee (feaadeeaca7db0594da854e7c8c07495341c7439)

@Zalathar

Copy link
Copy Markdown
Member

The test-various job looks stuck.

@bors yield
@bors try jobs=test-various

@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #163043.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
even more cleanups for `rustc_builtin_macros`


try-job: test-various
@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7a3dc2c (7a3dc2c2d77da28feed11a6dae035f3739dee995)
Base parent: feaadee (feaadeeaca7db0594da854e7c8c07495341c7439)

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 20, 2026
@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: nnethercote
Duration: 3h 7m 8s
Pushing bba5310 to main...

@rust-bors
rust-bors Bot merged commit bba5310 into rust-lang:main Sep 20, 2026
15 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 20, 2026
@cyrgani
cyrgani deleted the builtin-macros-4 branch September 20, 2026 20:21
@github-actions

Copy link
Copy Markdown
Contributor
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 12c4d3f (parent) -> bba5310 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard bba531001d4de6d7f49693e0836a2668ca063282 --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. test-x86_64-gnu-miri: 44m 57s -> 1h 23m (+86.0%)
  2. test-i686-gnu-2: 1h -> 1h 39m (+64.8%)
  3. test-x86_64-gnu-llvm-21-1: 57m 27s -> 34m 14s (-40.4%)
  4. dist-apple-various: 1h 36m -> 2h 14m (+40.0%)
  5. dist-various-2: 39m 14s -> 53m 28s (+36.3%)
  6. test-x86_64-gnu-llvm-21-2: 1h 39m -> 1h 3m (-35.9%)
  7. test-x86_64-gnu: 1h 54m -> 2h 33m (+34.7%)
  8. dist-sparcv9-solaris: 1h 15m -> 1h 41m (+34.3%)
  9. dist-i586-gnu-i586-i686-musl: 21m 16s -> 28m 13s (+32.7%)
  10. test-x86_64-msvc-2: 1h 59m -> 2h 37m (+31.9%)
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 (bba5310): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -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.6% [0.5%, 0.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 5
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.3%, secondary -2.4%)

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)
-2.3% [-2.4%, -2.3%] 2
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) -2.3% [-2.4%, -2.3%] 2

Cycles

Results (primary 1.8%, secondary 6.0%)

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

mean range count
Regressions ❌
(primary)
1.8% [1.3%, 2.4%] 2
Regressions ❌
(secondary)
6.0% [6.0%, 6.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.8% [1.3%, 2.4%] 2

Binary size

Results (primary 0.0%, 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.0% [0.0%, 0.1%] 15
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 15

Bootstrap: 496.862s -> 496.585s (-0.06%)
Artifact size: 408.74 MiB -> 408.87 MiB (0.03%)

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

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

8 participants