rustc_builtin_macros cleanup, part 6 - #163211
Conversation
|
Changes to the code generated for builtin derived traits. cc @nnethercote |
This comment has been minimized.
This comment has been minimized.
544b651 to
5657ac1
Compare
| .collect::<Vec<String>>(); | ||
| let prefixes: &[&str] = match selflike_args.len() { | ||
| 1 => &["__self"], | ||
| 2 => &["__self", "__arg1"], |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Why can the with_ctxt be removed?
There was a problem hiding this comment.
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]>, |
This comment has been minimized.
This comment has been minimized.
5657ac1 to
2196ae3
Compare
|
r=me once tests are green. @bors delegate=cyrgani |
|
✌️ @cyrgani, you can now approve this pull request! If @nnethercote told you to " |
|
@bors r=nnethercote |
…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)
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
|
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. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
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.
CyclesResults (secondary 2.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: missing data |
As the next step after #163080, this PR removes more unneeded complexity, including the "mini version of
Ty" and theFieldInfofor discriminants.r? @nnethercote