Skip to content

rustc_builtin_macros cleanup, part 6 - #163211

Merged
rust-bors[bot] merged 12 commits into
rust-lang:mainfrom
cyrgani:builtin-macros-6
Sep 24, 2026
Merged

rust-bors[bot] merged 12 commits into
rust-lang:mainfrom
cyrgani:builtin-macros-6

Conversation

@cyrgani

@cyrgani cyrgani commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

As the next step after #163080, this PR removes more unneeded complexity, including the "mini version of Ty" and the FieldInfo for discriminants.

r? @nnethercote

@rustbot

rustbot commented Sep 23, 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 23, 2026
@rust-log-analyzer

This comment has been minimized.

@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. Just one question below.

Also, you are allowed to write commit messages with more than one line :) Sometimes it's helpful to include an extra sentence or two explaining what is going on, or why it's being done.

View changes since this review

.collect::<Vec<String>>();
let prefixes: &[&str] = match selflike_args.len() {
1 => &["__self"],
2 => &["__self", "__arg1"],

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.

This is good. The old code seemed designed to be very generic and handle a wide variety of possible method signatures, when in practice they have only a few forms.

.map(|prefix| {
let pieces_iter =
struct_def.fields().iter().enumerate().map(|(i, struct_field)| {
let sp = struct_field.span.with_ctxt(self.span.ctxt());

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.

Why can the with_ctxt be removed?

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.

make_pattern_ident creates an ident with span self.span, so it already has the correct context and with_span_pos doesn't look at sps context


pub methods: SmallVec<[MethodDef<'a>; 1]>,

pub associated_types: SmallVec<[(Ident, Ty); 1]>,

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.

wow

@nnethercote nnethercote added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 23, 2026
@rust-log-analyzer

This comment has been minimized.

@nnethercote

Copy link
Copy Markdown
Contributor

r=me once tests are green.

@bors delegate=cyrgani

@rust-bors

rust-bors Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

✌️ @cyrgani, you can now approve this pull request!

If @nnethercote told you to "r=me" after making some further change, then please make that change and post @bors r=nnethercote.

View changes since this delegation.

@cyrgani

cyrgani commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=nnethercote

@rust-bors

rust-bors Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2196ae3 has been approved by nnethercote

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 24, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #162976 (fix quadratic naming of duplicate sidebar links)
 - #161275 (Refactor `core::cmp::{smallest, largest}` & add `mir-opt` test)
 - #163143 (cg_llvm: Use fewer FFI calls to check the target CPU's features)
 - #163188 (Adjust for Arm64EC name mangling when checking for exported symbols)
 - #163211 (`rustc_builtin_macros` cleanup, part 6)
 - #161386 (Don't merge distinct impl candidates)
 - #162942 (Remove `StashKey::AssociatedTypeSuggestion`)
 - #163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates)
 - #163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable)
 - #163185 (properly decrement available_depth on cycles and provisional cache hits)
 - #163214 (revert r14 register names for arm)
 - #163226 (miri subtree update)
 - #163228 (Add regression test for trait predicate with escaping bounds)
 - #163234 (`rustc_dump_symbol_name`: add demangling information as a note instead)
@rust-bors
rust-bors Bot merged commit 3e13f47 into rust-lang:main Sep 24, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 24, 2026
Rollup merge of #163211 - cyrgani:builtin-macros-6, r=nnethercote

`rustc_builtin_macros` cleanup, part 6

As the next step after #163080, this PR removes more unneeded complexity, including the "mini version of `Ty`" and the `FieldInfo` for discriminants.

r? @nnethercote
@cyrgani
cyrgani deleted the builtin-macros-6 branch September 24, 2026 16:15
@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 (4e54401): 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.6% [0.2%, 0.9%] 8
Regressions ❌
(secondary)
0.8% [0.6%, 0.9%] 5
Improvements ✅
(primary)
-0.4% [-0.5%, -0.3%] 12
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) -0.0% [-0.5%, 0.9%] 20

Max RSS (memory usage)

Results (primary -0.6%, 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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 2
Improvements ✅
(secondary)
-0.7% [-0.7%, -0.7%] 1
All ❌✅ (primary) -0.6% [-0.6%, -0.6%] 2

Cycles

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

Binary size

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

Bootstrap: missing data
Artifact size: 406.30 MiB -> 406.25 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Sep 24, 2026
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.

5 participants