Skip to content

fix #[loop_match] on diverging loop #144783

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 2 commits into
base: master
Choose a base branch
from

Conversation

folkertdev
Copy link
Contributor

@folkertdev folkertdev commented Aug 1, 2025

tracking issue: #132306

fixes #144492
fixes #143806
fixes #144493

fixes #144781

this generated invalid MIR before

r? @bjorn3

@folkertdev folkertdev added the F-loop_match when you match up with someone and they really throw you for a loop label Aug 1, 2025
@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 Aug 1, 2025
this generated invalid MIR before
@folkertdev folkertdev force-pushed the loop-match-diverging-loop branch from 13d09ba to 36bf31d Compare August 1, 2025 13:38
@bjorn3
Copy link
Member

bjorn3 commented Aug 1, 2025

r? compiler

given that this was debugged by the both of us.

@rustbot rustbot assigned SparrowLii and unassigned bjorn3 Aug 1, 2025
@folkertdev
Copy link
Contributor Author

I guess but also we have all the context here, it's a one-liner, and has no consequences outside of loop-match code.

@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2025

Some changes occurred in match lowering

cc @Nadrieril

Comment on lines -298 to +302
let scrutinee_place_builder =
unpack!(body_block = this.as_place_builder(body_block, scrutinee));
let scrutinee_span = this.thir.exprs[scrutinee].span;
let scrutinee_place_builder = unpack!(
body_block = this.lower_scrutinee(body_block, scrutinee, scrutinee_span)
);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this change adds a place mention of the scrutinee that was missing before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-loop_match when you match up with someone and they really throw you for a loop 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.
Projects
None yet
4 participants