Skip to content

Resolve infinite_loop FP for nested loops#16724

Open
mikhailofff wants to merge 1 commit intorust-lang:masterfrom
mikhailofff:fix/issue-16134
Open

Resolve infinite_loop FP for nested loops#16724
mikhailofff wants to merge 1 commit intorust-lang:masterfrom
mikhailofff:fix/issue-16134

Conversation

@mikhailofff
Copy link
Contributor

@mikhailofff mikhailofff commented Mar 17, 2026

Fixes #16134.

changelog: [infinite_loop]: look thoroughly the case when there are nested loops that cannot be infinite, because there is a break statement that interrupts another loop that takes up space above.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 17, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2026

r? @samueltardieu

rustbot has assigned @samueltardieu.
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: 7 candidates
  • 7 candidates expanded to 7 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Mar 17, 2026
@rustbot

This comment has been minimized.

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Mar 17, 2026
@rustbot

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2026

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.

Copy link
Member

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

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

break and continue have a field of type Destination which contains the HirId of the target of the break or continue. Can't you use that instead of labels to match the various blocks and loops that can be the target of the break?

View changes since this review

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

infinite-loop and never_loop trigger on the same loop 😆

3 participants