Clean up AST visitor some more - #162315
Conversation
|
LLM disclosure: most of these clean-ups were suggested by an LLM. I made all the code and text changes myself. |
|
Shouldn't affect perf, but just in case: @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.
…=<try> Clean up AST visitor some more
|
💥 Test timed out after |
Not sure what happened. Let's try again: @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.
…=<try> Clean up AST visitor some more
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d804d79): comparison URL. Overall result: ❌✅ regressions and improvements - 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 @bors rollup=never rustc-perf 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 2.2%, secondary 6.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -2.0%)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: 476.718s -> 480.953s (0.89%) |
|
Slight regressions on html5ever. I'll investigate on Monday. |
This comment has been minimized.
This comment has been minimized.
f9e5acf to
ad3c224
Compare
|
@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.
…=<try> Clean up AST visitor some more
The AST visitor code uses `($($extra_ty)?)` which expands to `()` in some cases and `(T)` in others, which requires `allow(unused_parens)` to avoid warnings. This commit splits the two `impl_visitable!` macros into two rules: one for the "no-extra" case and one for the "with-extra" case. There's a small amount of duplication between the two rules but there are multiple advantages. - The `allow(unused_parens)` is removed. - `impl_visitable!` callers can omit the extra param if it's `()`. - When the extra argument might or might not be present, a more standard `$(, $extra: $extra_ty)?` is now used. - No weird `let ($($extra)?) = extra;` destructuring. The `Visitable` derive also gets a tweak to avoid unnecessary parens around extra args.
These macros aren't needed outside the crate.
We can just hardwire `'a` and `Visitor`/`MutVisitor`. This simplifies the inputs for these macros from "leading thing + repeating elements" to just "repeating elements".
A lot of these lists are already almost in alphabetical order.
As requested by the reviewer.
ad3c224 to
44aee39
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I addressed the nit. @bors r=fee1-dead |
This comment has been minimized.
This comment has been minimized.
…=fee1-dead Clean up AST visitor some more A sequel to #162226. Details in individual commits. r? @fee1-dead
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for dd3ef79 failed: CI. Failed job:
|
|
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
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 b722b55 (parent) -> ed77b7b (this PR) Test differencesShow 4 test diffs4 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard ed77b7b8699e342c2dc842c83cb5fe4025252ee8 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (ed77b7b): comparison URL. Overall result: ❌ regressions - 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)This perf run didn't have relevant results for this metric. CyclesResults (primary -2.2%, secondary 9.4%)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: 498.957s -> 495.332s (-0.73%) |
View all comments
A sequel to #162226. Details in individual commits.
r? @fee1-dead