Repository navigation
rustc_builtin_macros cleanup, part 8 - #163485
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
[PERF] `rustc_builtin_macros` cleanup, part 8
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (0bcf40d): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -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.7%, secondary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 491.711s -> 491.207s (-0.10%) |
This comment has been minimized.
This comment has been minimized.
7eace55 to
c96f45e
Compare
rustc_builtin_macros cleanup, part 8rustc_builtin_macros cleanup, part 8
|
Some changes occurred in compiler/rustc_builtin_macros/src/autodiff.rs cc @ZuseZ4 |
|
@petrochenkov: do you have opinions about the first commit ("rename |
Yes :D #163485 (comment) |
These are especially useful for constructing types and paths referring to primitives.
As I understand it, this would only be needed if the crate defining the derive macros (which is `core`) was using edition 2015. Since `core` uses edition 2024, there is in this case no difference between global and local and we can skip the leading `::`.
Previously, `std_path` converted the given `&[Symbol]` to a `Vec<Ident>` by prepending a `$crate::` and mapping each `Symbol` to an `Ident`. This commit changes the functions that previously took `Vec<Ident>` to directly take `Path` instead, and updates `std_path` to also directly return a `Path`. This allows directly prepending the `$crate::` to the resulting `segments`. It also allows constructing a `Path` from `&[Ident]` instead of `Vec<Ident>`.
`new_path` is just a obsolete trivial wrapper around `cx.std_path_all` now.
Passing around `type_ident` everywhere is what the old code did as well, but it's actually only needed in two places.
And rename other places that were called `ident` but took a `Symbol` to `name` too.
c96f45e to
a85d97f
Compare
|
I added a commit that uses |
|
Thanks! @bors r+ |
…rcote `rustc_builtin_macros` cleanup, part 8 This PR is roughly split into three parts: - The first few commits add helpers to `ExtCtxt` to both construct some common AST elements in an easier way. They also change some `Ident` arguments to `Symbol` to avoid the annoying call-site pattern of repeating the span (`cx.some_method(span, Ident::new(name, span), ...)`). - The next few commits focus on the derive infrastructure cleanup a bit. - The further following commits make `Path` construction faster and remove the `new_path` remnant of the old local path version. Previous PR: rust-lang#163389 r? @nnethercote
…uwer Rollup of 8 pull requests Successful merges: - #162460 (Feat - `#[inline(always)] + #[target_feature(enable = "....")]` #2) - #163485 (`rustc_builtin_macros` cleanup, part 8) - #164578 (Don't ignore unknown LLVM diagnostics) - #162369 (Document the `recursion_limit` built-in attribute) - #162840 (tier 3 target policy: target CPU and features must be supported by upstream backend) - #164330 (Skip redundant monomorphization checks) - #164656 (stabilize ExitCodeExt for Windows) - #164660 (Touch up attribute docs)
…rcote `rustc_builtin_macros` cleanup, part 8 This PR is roughly split into three parts: - The first few commits add helpers to `ExtCtxt` to both construct some common AST elements in an easier way. They also change some `Ident` arguments to `Symbol` to avoid the annoying call-site pattern of repeating the span (`cx.some_method(span, Ident::new(name, span), ...)`). - The next few commits focus on the derive infrastructure cleanup a bit. - The further following commits make `Path` construction faster and remove the `new_path` remnant of the old local path version. Previous PR: rust-lang#163389 r? @nnethercote
|
⌛ Testing commit a85d97f with merge ae9d6d5... Workflow: https://github.com/rust-lang/rust/actions/runs/39634220880 |
`rustc_builtin_macros` cleanup, part 8 This PR is roughly split into three parts: - The first few commits add helpers to `ExtCtxt` to both construct some common AST elements in an easier way. They also change some `Ident` arguments to `Symbol` to avoid the annoying call-site pattern of repeating the span (`cx.some_method(span, Ident::new(name, span), ...)`). - The next few commits focus on the derive infrastructure cleanup a bit. - The further following commits make `Path` construction faster and remove the `new_path` remnant of the old local path version. Previous PR: #163389 r? @nnethercote
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #164699. |
…uwer Rollup of 13 pull requests Successful merges: - #162460 (Feat - `#[inline(always)] + #[target_feature(enable = "....")]` #2) - #163485 (`rustc_builtin_macros` cleanup, part 8) - #164457 (Add `vec_visualizer` lldb test) - #161253 (Implement `AsMut<T>` and `AsRef<T>` for `!`.) - #162369 (Document the `recursion_limit` built-in attribute) - #162840 (tier 3 target policy: target CPU and features must be supported by upstream backend) - #164329 (use default_field_values in declare_lint) - #164330 (Skip redundant monomorphization checks) - #164527 (doc: added addtional docs for Write) - #164656 (stabilize ExitCodeExt for Windows) - #164660 (Touch up attribute docs) - #164681 (tidy: use repository-relative path for style checks) - #164688 (re-enable test_dir_remove_dir test on QNX)
Rollup merge of #163485 - cyrgani:builtin-macros-8, r=nnethercote `rustc_builtin_macros` cleanup, part 8 This PR is roughly split into three parts: - The first few commits add helpers to `ExtCtxt` to both construct some common AST elements in an easier way. They also change some `Ident` arguments to `Symbol` to avoid the annoying call-site pattern of repeating the span (`cx.some_method(span, Ident::new(name, span), ...)`). - The next few commits focus on the derive infrastructure cleanup a bit. - The further following commits make `Path` construction faster and remove the `new_path` remnant of the old local path version. Previous PR: #163389 r? @nnethercote
|
Note This PR was benchmarked as part of triage of its containing rollup: triage URL. Finished benchmarking commit (6351b4b): comparison URL. Overall result: ✅ improvements - no action needed@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 (secondary -2.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Artifact size: 406.57 MiB -> 406.49 MiB (-0.02%) |
View all comments
This PR is roughly split into three parts:
ExtCtxtto both construct some common AST elements in an easier way. They also change someIdentarguments toSymbolto avoid the annoying call-site pattern of repeating the span (cx.some_method(span, Ident::new(name, span), ...)).Pathconstruction faster and remove thenew_pathremnant of the old local path version.Previous PR: #163389
r? @nnethercote