Skip to content

Rename impl_of_method and trait_of_item #144377

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

camsteffen
Copy link
Contributor

@camsteffen camsteffen commented Jul 23, 2025

This PR used to tweak the implementation of impl_of_method, but that introduced a perf regression.

Rename impl_of_method and trait_of_item to impl_of_assoc and trait_of_assoc respectively. This reflects how the two functions are closely related. And it reflects the behavior more accurately as the functions check whether the input is an associated item.

@rustbot
Copy link
Collaborator

rustbot commented Jul 23, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jul 23, 2025
@rust-log-analyzer

This comment has been minimized.

@camsteffen camsteffen force-pushed the simplify-impl-of-method branch from 230e8b9 to e019fd7 Compare July 23, 2025 21:04
@Kobzol
Copy link
Member

Kobzol commented Jul 24, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 24, 2025

⌛ Trying commit e019fd7 with merge bf4a373

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 24, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 24, 2025
@fee1-dead
Copy link
Member

fee1-dead commented Jul 24, 2025

this should really be renamed to opt_impl_parent or impl_of_assoc instead.

r=me after good/neutral perf, rename can be in followup

@rust-bors
Copy link

rust-bors bot commented Jul 24, 2025

☀️ Try build successful (CI)
Build commit: bf4a373 (bf4a373133f6ff486e137e70291a5d9e95fe7fae, parent: 3c30dbbe31bfbf6029f4534170165ba573ff0fd1)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bf4a373): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

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.4% [0.1%, 0.7%] 17
Regressions ❌
(secondary)
0.3% [0.0%, 0.6%] 24
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.1%, 0.7%] 17

Max RSS (memory usage)

Results (primary -1.4%, secondary -1.8%)

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)
-1.4% [-2.3%, -0.9%] 4
Improvements ✅
(secondary)
-1.8% [-2.8%, -1.2%] 4
All ❌✅ (primary) -1.4% [-2.3%, -0.9%] 4

Cycles

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

Binary size

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

Bootstrap: 468.586s -> 466.337s (-0.48%)
Artifact size: 374.68 MiB -> 374.63 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 Jul 24, 2025
@camsteffen
Copy link
Contributor Author

Hmm that doesn't look like a win. I guess it's because the non assoc input case is now parent+def_kind where it used to be just def_kind. There could be an opportunity to split out a panicking version but I'm not sure if that's worth it either.

Agreed about the rename.

@fee1-dead
Copy link
Member

Well, i'd be happy to r+ if you repurpose this PR so that it's just the renaming :)

@camsteffen camsteffen force-pushed the simplify-impl-of-method branch from e019fd7 to 448868a Compare July 25, 2025 00:10
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. PG-exploit-mitigations Project group: Exploit mitigations T-clippy Relevant to the Clippy team. labels Jul 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 25, 2025

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in need_type_info.rs

cc @lcnr

Some changes occurred in coverage instrumentation.

cc @Zalathar

Some changes occurred to constck

cc @fee1-dead

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

HIR ty lowering was modified

cc @fmease

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_sanitizers

cc @rcvalle

@camsteffen camsteffen changed the title Simplify impl_of_method Rename impl_of_method and trait_of_item Jul 25, 2025
@camsteffen
Copy link
Contributor Author

Oooof that's a lot of tags 🫣

@fee1-dead
Copy link
Member

still potentially perf sensitive, so

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 25, 2025

⌛ Trying commit 448868a with merge 0ed9f77

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 25, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 25, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 25, 2025

☀️ Try build successful (CI)
Build commit: 0ed9f77 (0ed9f7760563aed64235fd1e43fab19fd2c27b88, parent: b56aaec52bc0fa35591a872fb4aac81f606e265c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0ed9f77): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

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

Instruction count

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

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: 469.891s -> 468.327s (-0.33%)
Artifact size: 374.63 MiB -> 374.67 MiB (0.01%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jul 25, 2025
@fee1-dead
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 25, 2025

📌 Commit 448868a has been approved by fee1-dead

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 Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. 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.

7 participants