Skip to content

Do not propose to refactor when no variant constructor is used#16867

Merged
Jarcho merged 1 commit intorust-lang:masterfrom
samueltardieu:issues/16861
Apr 16, 2026
Merged

Do not propose to refactor when no variant constructor is used#16867
Jarcho merged 1 commit intorust-lang:masterfrom
samueltardieu:issues/16861

Conversation

@samueltardieu
Copy link
Copy Markdown
Member

@samueltardieu samueltardieu commented Apr 16, 2026

If all the ways to "leave" the closure is through a divergent statement other than return (not detected as a potential return value by the visitor), do not trigger the lint.

changelog: [bind_instead_of_map]: do not propose to rewrite the expression if the only way to leave the closure is through a divergent statement other than return

Fixes #16861

If all the ways to "leave" the closure is through a divergent statement
other than `return` (not detected as a potential return value by the
visitor), do not trigger the lint.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 16, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 16, 2026

r? @Jarcho

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

Copy link
Copy Markdown
Contributor

@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

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

@Jarcho Jarcho added this pull request to the merge queue Apr 16, 2026
Merged via the queue into rust-lang:master with commit 2e1628a Apr 16, 2026
11 of 13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 16, 2026
@samueltardieu samueltardieu deleted the issues/16861 branch April 16, 2026 20:13
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.

False positive bind_instead_of_map when panicking.

3 participants