Skip to content
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

Cleanup op lookup in HIR typeck #132274

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

compiler-errors
Copy link
Member

Minor cleanup for some redundant methods involved with looking up the Operator::operator methods for operators.

@rustbot
Copy link
Collaborator

rustbot commented Oct 28, 2024

r? @nnethercote

rustbot has assigned @nnethercote.
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 Oct 28, 2024
@nnethercote
Copy link
Contributor

Second commit looks fine. The first commit seems to be duplicating code for no clear reason, the commit log doesn't have an explanation why inlining is benefifical, the PR description mentions "redundant methods" with no further explanation, the benefit isn't clear to me.

@compiler-errors
Copy link
Member Author

The duplicated codepath is on the error path, and creating some arguments is not significant enough to make a whole method out of it.

@compiler-errors
Copy link
Member Author

Removed some more goofy slicing logic that we used to pass an additional RHS ty in lookup_method_in_trait.

I still think removing obligation_for_method is better than keeping it around for one callsite on the good-path and one callsite on the error path.

@nnethercote
Copy link
Contributor

Good enough, r=me unless you are planning to add more changes here.

@compiler-errors
Copy link
Member Author

No, if I find more then I will open a follow-up. Just noticed this while working on const traits.

@bors r=nnethercote

@bors
Copy link
Contributor

bors commented Oct 28, 2024

📌 Commit 3240fe2 has been approved by nnethercote

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 Oct 28, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Oct 29, 2024
… r=nnethercote

Cleanup op lookup in HIR typeck

Minor cleanup for some redundant methods involved with looking up the `Operator::operator` methods for operators.
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Oct 29, 2024
… r=nnethercote

Cleanup op lookup in HIR typeck

Minor cleanup for some redundant methods involved with looking up the `Operator::operator` methods for operators.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 29, 2024
…kingjubilee

Rollup of 10 pull requests

Successful merges:

 - rust-lang#131375 (compiler: apply clippy::clone_on_ref_ptr for CI)
 - rust-lang#132119 (Hack out effects support for old solver)
 - rust-lang#132151 (Ensure that resume arg outlives region bound for coroutines)
 - rust-lang#132216 (correct LLVMRustCreateThinLTOData arg types)
 - rust-lang#132233 (Split `boxed.rs` into a few modules)
 - rust-lang#132266 (riscv-soft-abi-with-float-features.rs: adapt for LLVM 20)
 - rust-lang#132270 (clarified doc for `std::fs::OpenOptions.truncate()`)
 - rust-lang#132274 (Cleanup op lookup in HIR typeck)
 - rust-lang#132284 (Remove my ping for rustdoc/clean/types.rs)
 - rust-lang#132293 (Remove myself from mentions inside `tests/ui/check-cfg` directory)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 29, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#131984 (Stabilize if_let_rescope)
 - rust-lang#132151 (Ensure that resume arg outlives region bound for coroutines)
 - rust-lang#132157 (Remove detail from label/note that is already available in other note)
 - rust-lang#132274 (Cleanup op lookup in HIR typeck)
 - rust-lang#132319 (cg_llvm: Clean up FFI calls for setting module flags)
 - rust-lang#132321 (xous: sync: remove `rustc_const_stable` attribute on Condvar and Mutex new())

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1e3c0da into rust-lang:master Oct 29, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 29, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 29, 2024
Rollup merge of rust-lang#132274 - compiler-errors:cleanup-op-lookup, r=nnethercote

Cleanup op lookup in HIR typeck

Minor cleanup for some redundant methods involved with looking up the `Operator::operator` methods for operators.
@Kobzol
Copy link
Contributor

Kobzol commented Oct 30, 2024

@rust-timer build 5c93586

Checking if this might be the source of the regression in #132326.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5c93586): comparison URL.

Overall result: no relevant changes - no action needed

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.

@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 -3.8%)

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.8% [-4.0%, -3.5%] 2
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.2%)

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

Binary size

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

Bootstrap: 784.999s -> 783.481s (-0.19%)
Artifact size: 333.64 MiB -> 333.63 MiB (-0.00%)

@compiler-errors compiler-errors deleted the cleanup-op-lookup branch October 31, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants