Skip to content

deeper rustc_builtin_macros cleanups - #161867

Merged
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
cyrgani:builtin-macros-deeper-clean
Sep 11, 2026
Merged

deeper rustc_builtin_macros cleanups#161867
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
cyrgani:builtin-macros-deeper-clean

Conversation

@cyrgani

@cyrgani cyrgani commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

View all comments

As a followup to #161464, this contains a few more surface cleanups and begins simplifying the mess that SubstructureFields currently is by removing the StaticFields type in favor of just using the VariantData directly.

@rustbot

rustbot commented Aug 27, 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 Aug 27, 2026
@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

r? @adwinwhite

rustbot has assigned @adwinwhite.
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 75 candidates
  • Random selection from 17 candidates

@Kobzol

Kobzol commented Aug 27, 2026

Copy link
Copy Markdown
Member

@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 Aug 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 27, 2026
@rust-bors

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: cc25c3c (cc25c3c8dae9c6546d9fdd11168f5e7c5715a163)
Base parent: e457a7b (e457a7b0d326d67b4322ef0d11bd715cfaeda48f)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (cc25c3c): 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
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 3

Max RSS (memory usage)

Results (primary -1.0%, secondary -3.9%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-3.1%, -2.3%] 2
Improvements ✅
(secondary)
-3.9% [-6.3%, -1.5%] 2
All ❌✅ (primary) -1.0% [-3.1%, 2.3%] 3

Cycles

Results (primary -1.1%, secondary 0.3%)

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

mean range count
Regressions ❌
(primary)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
-2.1% [-2.4%, -2.0%] 3
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) -1.1% [-2.4%, 2.0%] 4

Binary size

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

Bootstrap: 476.343s -> 474.625s (-0.36%)
Artifact size: 402.74 MiB -> 402.73 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 27, 2026
Comment thread compiler/rustc_builtin_macros/src/deriving/generic/mod.rs Outdated
@rust-cloud-vms
rust-cloud-vms Bot force-pushed the builtin-macros-deeper-clean branch from 979ef46 to 40d4c72 Compare August 28, 2026 11:58
@rust-bors

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the builtin-macros-deeper-clean branch from 4178dac to 3c3c3cd Compare September 3, 2026 17:51
@adwinwhite

Copy link
Copy Markdown
Contributor

Looks good. Just be cautious.
@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 Sep 9, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
@rust-bors

rust-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a510775 (a510775f2a232b0a2ba1de120a471b803f4c3bf5)
Base parent: 0d31508 (0d31508599a7814a7044e9a7a871e3dc5f037753)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a510775): comparison URL.

Overall result: ❌ regressions - 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.3% [0.2%, 0.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.3%] 3

Max RSS (memory usage)

Results (primary 0.4%, secondary -0.7%)

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%, 2.0%] 2
Regressions ❌
(secondary)
2.9% [2.2%, 3.6%] 2
Improvements ✅
(primary)
-0.4% [-0.5%, -0.4%] 2
Improvements ✅
(secondary)
-7.9% [-7.9%, -7.9%] 1
All ❌✅ (primary) 0.4% [-0.5%, 2.0%] 4

Cycles

Results (primary 0.5%, secondary 2.8%)

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

mean range count
Regressions ❌
(primary)
0.9% [0.4%, 2.6%] 12
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-0.8% [-1.4%, -0.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-1.4%, 2.6%] 16

Binary size

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

Bootstrap: 480.949s -> 481.341s (0.08%)
Artifact size: 403.34 MiB -> 403.36 MiB (0.01%)

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

adwinwhite commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

the small perf win on libc becomes a regression after the push 🤔
Is this noise or not?

@cyrgani

cyrgani commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

I think it is; I didn't change anything since then except for rebasing and I can't reproduce it locally either (it becomes a very small improvement).

@adwinwhite

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3c3c3cd has been approved by adwinwhite

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 Sep 11, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 11, 2026
…n, r=adwinwhite

deeper `rustc_builtin_macros` cleanups

As a followup to rust-lang#161464, this contains a few more surface cleanups and begins simplifying the mess that `SubstructureFields` currently is by removing the `StaticFields` type in favor of just using the `VariantData` directly.
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #162126 (Rename various resolving functions for consistency, and document them)
 - #162520 (Refactor `HygieneEncodeContext`)
 - #154373 (Skip linting unused braces for FunctionArg and MethodArg context for 2024 later )
 - #160023 (Refactor the way cg_ssa handles indirect returns (returns via `sret`) — Take 2)
 - #161482 (Use attribute parser for `#[non_exhaustive]` attribute check)
 - #161867 (deeper `rustc_builtin_macros` cleanups)
 - #162099 (small refactor of doc attribute arguments warnings)
 - #162541 (split `macroless_generic_const_args` in two)
 - #162549 (The fuchsia team maintains `riscv64gc-unknown-fuchsia`)
 - #162577 (Fix `i686-pc-windows-msvc` platform support docs and target spec metadata)
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 11, 2026
…n, r=adwinwhite

deeper `rustc_builtin_macros` cleanups

As a followup to rust-lang#161464, this contains a few more surface cleanups and begins simplifying the mess that `SubstructureFields` currently is by removing the `StaticFields` type in favor of just using the `VariantData` directly.
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #162520 (Refactor `HygieneEncodeContext`)
 - #154373 (Skip linting unused braces for FunctionArg and MethodArg context for 2024 later )
 - #160023 (Refactor the way cg_ssa handles indirect returns (returns via `sret`) — Take 2)
 - #160860 (Implement arbitrary casts in custom mir)
 - #161482 (Use attribute parser for `#[non_exhaustive]` attribute check)
 - #161867 (deeper `rustc_builtin_macros` cleanups)
 - #162099 (small refactor of doc attribute arguments warnings)
 - #162541 (split `macroless_generic_const_args` in two)
 - #162549 (The fuchsia team maintains `riscv64gc-unknown-fuchsia`)
 - #162577 (Fix `i686-pc-windows-msvc` platform support docs and target spec metadata)
 - #162624 (regression test for opaque field projection in closure capture)
@rust-bors
rust-bors Bot merged commit 57c92bc into rust-lang:main Sep 11, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 11, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
Rollup merge of #161867 - cyrgani:builtin-macros-deeper-clean, r=adwinwhite

deeper `rustc_builtin_macros` cleanups

As a followup to #161464, this contains a few more surface cleanups and begins simplifying the mess that `SubstructureFields` currently is by removing the `StaticFields` type in favor of just using the `VariantData` directly.
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (022c464): comparison URL.

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

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%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.2%, 0.2%] 6

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: missing data
Artifact size: 407.63 MiB -> 406.87 MiB (-0.19%)

@cyrgani
cyrgani deleted the builtin-macros-deeper-clean branch September 11, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

6 participants