Skip to content

fix: Port block and loop inference from rustc#22473

Merged
ChayimFriedman2 merged 2 commits into
rust-lang:masterfrom
ChayimFriedman2:labelled-break
May 28, 2026
Merged

fix: Port block and loop inference from rustc#22473
ChayimFriedman2 merged 2 commits into
rust-lang:masterfrom
ChayimFriedman2:labelled-break

Conversation

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

No description provided.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 27, 2026
@Veykril Veykril added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@ChayimFriedman2

Copy link
Copy Markdown
Contributor Author

New Rust, new Clippy!

This fixes one diagnostic on self.
I.e., consider a block diverging if its tail expr is diverging, even if it doesn't have type never.

This became important now that blocks coerce the tail expression's type to the expected type instead of coercing themselves, but in fact the logic was always incorrect - a statement *in the middle of* a block can be diverging without the block having never type. This situation is still not handled correctly, which is why I also left a comment for maybe having a side map for this.
@rustbot

rustbot commented May 28, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master 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.

@ChayimFriedman2 ChayimFriedman2 enabled auto-merge May 28, 2026 20:58
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue May 28, 2026
Merged via the queue into rust-lang:master with commit 7bd9031 May 28, 2026
18 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the labelled-break branch May 28, 2026 21:17
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 28, 2026
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.

3 participants