Skip to content

avoid some usages of &mut P<T> in AST visitors #141636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025

Conversation

fee1-dead
Copy link
Member

@fee1-dead fee1-dead commented May 27, 2025

It's a double indirection, and is also complicating our efforts at #127615.

r? @ghost

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 27, 2025
@fee1-dead fee1-dead force-pushed the push-ntqvvxwuvrvx branch from 6fb4dbf to acceb9c Compare May 27, 2025 07:22
@fee1-dead
Copy link
Member Author

@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 May 27, 2025
bors added a commit that referenced this pull request May 27, 2025
[experiment] don't use `&mut P<T>` in AST visitors

It's a double redirection, and is also complicating our efforts at #127615.

Conflicts with #141430 and #141635.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented May 27, 2025

⌛ Trying commit acceb9c with merge 4a1cd44...

@bors
Copy link
Collaborator

bors commented May 27, 2025

☀️ Try build successful - checks-actions
Build commit: 4a1cd44 (4a1cd44d9867333108af383dfaa8024f036ab9e3)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4a1cd44): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.6% [0.1%, 1.6%] 3
Regressions ❌
(secondary)
0.7% [0.1%, 1.5%] 17
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.1%] 8
All ❌✅ (primary) 0.4% [-0.2%, 1.6%] 4

Max RSS (memory usage)

Results (primary 1.6%, secondary 0.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.6% [1.4%, 2.0%] 3
Regressions ❌
(secondary)
2.3% [1.2%, 5.0%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-5.5%, -2.2%] 5
All ❌✅ (primary) 1.6% [1.4%, 2.0%] 3

Cycles

Results (primary 0.2%, secondary -4.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.6% [1.6%, 1.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
-4.0% [-4.9%, -2.8%] 12
All ❌✅ (primary) 0.2% [-1.1%, 1.6%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 779.351s -> 779.139s (-0.03%)
Artifact size: 366.34 MiB -> 366.37 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 May 27, 2025
@petrochenkov
Copy link
Contributor

cc #132112
r? @petrochenkov

@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 27, 2025
@fee1-dead fee1-dead force-pushed the push-ntqvvxwuvrvx branch 2 times, most recently from 245ef7c to 28d2242 Compare May 27, 2025 11:48
@fee1-dead fee1-dead changed the title [experiment] don't use &mut P<T> in AST visitors avoid some usages of &mut P<T> in AST visitors May 27, 2025
@fee1-dead fee1-dead force-pushed the push-ntqvvxwuvrvx branch from 28d2242 to ff785b5 Compare May 27, 2025 11:50
@fee1-dead
Copy link
Member Author

I've left out the big three - visit_ty, visit_expr, and visit_pat in this PR as that complicates the handling in rustc_expand. Everything left should now be trivial.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 27, 2025
@fee1-dead fee1-dead marked this pull request as ready for review May 27, 2025 11:51
@rustbot

This comment was marked as outdated.

@fee1-dead fee1-dead force-pushed the push-ntqvvxwuvrvx branch from ff785b5 to 809f276 Compare May 27, 2025 11:51
@petrochenkov
Copy link
Contributor

@bors r+ rollup=maybe

@bors
Copy link
Collaborator

bors commented May 27, 2025

📌 Commit 809f276 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors 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 May 27, 2025
bors added a commit that referenced this pull request May 27, 2025
Rollup of 8 pull requests

Successful merges:

 - #141312 (Add From<TryLockError> for io::Error)
 - #141495 (Rename `{GenericArg,Term}::unpack()` to `kind()`)
 - #141602 (triagebot: label LLVM submodule changes with `A-LLVM`)
 - #141632 (remove `visit_mt` from `ast::mut_visit`)
 - #141640 (test: convert version_check ui test to run-make)
 - #141645 (bump fluent-* crates)
 - #141650 (coverage: Revert "unused local file IDs" due to empty function names)
 - #141654 (tests: mark option-niche-eq as fixed on LLVM 21)

Failed merges:

 - #141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - #141636 (avoid some usages of `&mut P<T>` in AST visitors)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented May 27, 2025

☔ The latest upstream changes (presumably #141644) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 27, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request May 28, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#141312 (Add From<TryLockError> for io::Error)
 - rust-lang/rust#141495 (Rename `{GenericArg,Term}::unpack()` to `kind()`)
 - rust-lang/rust#141602 (triagebot: label LLVM submodule changes with `A-LLVM`)
 - rust-lang/rust#141632 (remove `visit_mt` from `ast::mut_visit`)
 - rust-lang/rust#141640 (test: convert version_check ui test to run-make)
 - rust-lang/rust#141645 (bump fluent-* crates)
 - rust-lang/rust#141650 (coverage: Revert "unused local file IDs" due to empty function names)
 - rust-lang/rust#141654 (tests: mark option-niche-eq as fixed on LLVM 21)

Failed merges:

 - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors)

r? `@ghost`
`@rustbot` modify labels: rollup
@fee1-dead fee1-dead force-pushed the push-ntqvvxwuvrvx branch from 809f276 to 367a877 Compare May 29, 2025 04:55
@fee1-dead
Copy link
Member Author

@bors r=petrochenkov

@bors
Copy link
Collaborator

bors commented May 29, 2025

📌 Commit 367a877 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors 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 May 29, 2025
bors added a commit that referenced this pull request May 29, 2025
Rollup of 4 pull requests

Successful merges:

 - #138285 (Stabilize `repr128`)
 - #139994 (add `CStr::display`)
 - #141571 (coretests: extend and simplify float tests)
 - #141656 (CI: Add cargo tests to aarch64-apple-darwin)

Failed merges:

 - #141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - #141636 (avoid some usages of `&mut P<T>` in AST visitors)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request May 29, 2025
Rollup of 11 pull requests

Successful merges:

 - #137574 (Make `std/src/num` mirror `core/src/num`)
 - #141384 (Enable review queue tracking)
 - #141448 (A variety of improvements to the codegen backends)
 - #141636 (avoid some usages of `&mut P<T>` in AST visitors)
 - #141676 (float: Disable `total_cmp` sNaN tests for `f16`)
 - #141705 (Add eslint as part of `tidy` run)
 - #141715 (Add `loongarch64` with `d` feature to `f32::midpoint` fast path)
 - #141723 (Provide secrets to try builds with new bors)
 - #141728 (Fix false documentation of FnCtxt::diverges)
 - #141729 (resolve target-libdir directly from rustc)
 - #141732 (creader: Remove extraenous String::clone)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request May 29, 2025
Rollup of 11 pull requests

Successful merges:

 - #137574 (Make `std/src/num` mirror `core/src/num`)
 - #141384 (Enable review queue tracking)
 - #141448 (A variety of improvements to the codegen backends)
 - #141636 (avoid some usages of `&mut P<T>` in AST visitors)
 - #141676 (float: Disable `total_cmp` sNaN tests for `f16`)
 - #141705 (Add eslint as part of `tidy` run)
 - #141715 (Add `loongarch64` with `d` feature to `f32::midpoint` fast path)
 - #141723 (Provide secrets to try builds with new bors)
 - #141728 (Fix false documentation of FnCtxt::diverges)
 - #141729 (resolve target-libdir directly from rustc)
 - #141732 (creader: Remove extraenous String::clone)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2b08e4d into rust-lang:master May 30, 2025
9 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 30, 2025
rust-timer added a commit that referenced this pull request May 30, 2025
Rollup merge of #141636 - fee1-dead-contrib:push-ntqvvxwuvrvx, r=petrochenkov

avoid some usages of `&mut P<T>` in AST visitors

It's a double indirection, and is also complicating our efforts at #127615.

r? `@ghost`
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