Skip to content

fix: Do not consider loop containing break expr to not diverge if expr is diverging - #23127

Merged
Veykril merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:break-diverge
Aug 12, 2026
Merged

Veykril merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:break-diverge

Conversation

@ChayimFriedman2

@ChayimFriedman2 ChayimFriedman2 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

E.g. break return.

Also refactor the code a bit to avoid looping the breakables stack multiple times.

Fixes #23098.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2026
@Veykril
Veykril added this pull request to the merge queue Aug 12, 2026
Merged via the queue into rust-lang:master with commit 068bb50 Aug 12, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2026
@ChayimFriedman2
ChayimFriedman2 deleted the break-diverge branch August 12, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FP expected i32, found () loop { break (return 5); }

3 participants