Skip to content

refactor rustc_hir_typeck/src/op.rs#154223

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
malezjaa:refactor-typecheck-op
Apr 9, 2026
Merged

refactor rustc_hir_typeck/src/op.rs#154223
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
malezjaa:refactor-typecheck-op

Conversation

@malezjaa
Copy link
Copy Markdown
Contributor

@malezjaa malezjaa commented Mar 22, 2026

View all comments

Fixes #64297

This is a refactoring PR with no logic or behaviour changes. I tried to improve readability of op.rs, which had a few very large functions using some suboptimal syntax. I broke these up into smaller helpers.

@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 Mar 22, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 22, 2026

r? @adwinwhite

rustbot has assigned @adwinwhite.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 13 candidates

@rust-log-analyzer

This comment has been minimized.

@malezjaa malezjaa force-pushed the refactor-typecheck-op branch from 60bad65 to f803f56 Compare March 22, 2026 19:53
@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Mar 22, 2026

This is a fairly large PR -- could you help reviewers by adding some context to the description? It would be great to have a summary of what was changed, the key decisions made and the reasoning behind them, and ideally a breakdown into separate commits to make it easier to review piece by piece.

@malezjaa
Copy link
Copy Markdown
Contributor Author

Updated the description. There weren't really any key decisions to make since this is a refactor with no behaviour changes. As for separate commits, splitting style changes after the fact would be tedious and I'm not sure it would add much value for reviewers.

@rust-bors

This comment has been minimized.

@malezjaa malezjaa closed this Apr 4, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 4, 2026
@adwinwhite
Copy link
Copy Markdown
Contributor

@malezjaa I'm really sorry that I didn't get to this quickly. Thank you for trying to clean this up.
This change is still very desirable. I will do the review in a timely manner if you're still willing to working on it. That said, if you don't want to continue with this PR, that's completely okay.

@malezjaa malezjaa deleted the refactor-typecheck-op branch April 5, 2026 07:49
@malezjaa malezjaa restored the refactor-typecheck-op branch April 5, 2026 07:49
@malezjaa
Copy link
Copy Markdown
Contributor Author

malezjaa commented Apr 5, 2026

I am also sorry for closing this so quickly. I’ll try to resolve these merge conflicts as soon as I can.

@malezjaa malezjaa reopened this Apr 5, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 5, 2026
@malezjaa malezjaa force-pushed the refactor-typecheck-op branch from f803f56 to 572d1dc Compare April 5, 2026 10:25
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 5, 2026

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.

@adwinwhite
Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 6, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 6, 2026
@malezjaa
Copy link
Copy Markdown
Contributor Author

malezjaa commented Apr 7, 2026

@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 Apr 7, 2026
@adwinwhite
Copy link
Copy Markdown
Contributor

Did you forget to push?

@malezjaa
Copy link
Copy Markdown
Contributor Author

malezjaa commented Apr 8, 2026

Sorry for the confusion 😅, but the only change I made after reopening was the rebase to fix merge conflicts. I also updated the PR description a while back when it was requested. Is there something I should be pushing? I don't see any review comments.

@adwinwhite
Copy link
Copy Markdown
Contributor

adwinwhite commented Apr 8, 2026

That's strange. I did leave several inline comments
Sorry, I forgot to press the submit button

@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Apr 8, 2026

one of possibilities is that you didn't pressed "submit review" green button or whatever it called

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2026
@malezjaa
Copy link
Copy Markdown
Contributor Author

malezjaa commented Apr 8, 2026

I'll squash the commits after review

@malezjaa
Copy link
Copy Markdown
Contributor Author

malezjaa commented Apr 8, 2026

@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 Apr 8, 2026
@adwinwhite
Copy link
Copy Markdown
Contributor

r=me after squashing

@bors delegate+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

✌️ @malezjaa, you can now approve this pull request!

If @adwinwhite told you to "r=me" after making some further change, then please make that change and post @bors r=adwinwhite.

@malezjaa malezjaa force-pushed the refactor-typecheck-op branch from 85f5b8a to 118edea Compare April 9, 2026 08:27
@malezjaa
Copy link
Copy Markdown
Contributor Author

malezjaa commented Apr 9, 2026

@bors r=adwinwhite

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

📌 Commit 118edea has been approved by adwinwhite

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Apr 9, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

☀️ Test successful - CI
Approved by: adwinwhite
Duration: 3h 13m 32s
Pushing 4c42051 to main...

@rust-bors rust-bors bot merged commit 4c42051 into rust-lang:main Apr 9, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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 1948ee1 (parent) -> 4c42051 (this PR)

Test differences

Show 3 test diffs

3 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 4c4205163abcbd08948b3efab796c543ba1ea687 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 2h 29m -> 1h 46m (-28.4%)
  2. dist-android: 27m 40s -> 22m 2s (-20.4%)
  3. i686-gnu-2: 1h 44m -> 1h 26m (-17.0%)
  4. i686-gnu-nopt-1: 2h 19m -> 1h 55m (-16.7%)
  5. x86_64-rust-for-linux: 52m 42s -> 45m 5s (-14.4%)
  6. dist-apple-various: 1h 42m -> 1h 56m (+13.5%)
  7. test-various: 2h 6m -> 1h 50m (-12.9%)
  8. aarch64-apple: 3h 27m -> 3h (-12.6%)
  9. armhf-gnu: 1h 29m -> 1h 18m (-11.7%)
  10. x86_64-gnu-tools: 1h 3m -> 57m 2s (-10.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

self.apply_adjustments(lhs_expr, vec![autoref]);
}
}
if by_ref_binop {
Copy link
Copy Markdown
Member

@hkBst hkBst Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View changes since the review

This condition seems to have been lost.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I merged it with the above if without thinking. I'll open a follow up pr. Sorry about that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I'm surprised though that this was not caught by a test; although I'm not really sure what the effect of this is either...

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4c42051): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Cycles

Results (primary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.4% [2.4%, 2.4%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.984s -> 489.441s (-0.31%)
Artifact size: 395.64 MiB -> 395.61 MiB (-0.01%)

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 9, 2026
…adwinwhite

Fix if branch in op.rs

I removed the if guard without thinking in rust-lang#154223. Really sorry about this.

r? @hkBst
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 9, 2026
…adwinwhite

Fix if branch in op.rs

I removed the if guard without thinking in rust-lang#154223. Really sorry about this.

r? @hkBst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

Cleanup: Refactor rustc_typeck/check/op.rs

7 participants