Skip to content

return can be removed from the last stmt of a block if it has an expr#16959

Open
samueltardieu wants to merge 1 commit into
rust-lang:masterfrom
samueltardieu:issues/16958
Open

return can be removed from the last stmt of a block if it has an expr#16959
samueltardieu wants to merge 1 commit into
rust-lang:masterfrom
samueltardieu:issues/16958

Conversation

@samueltardieu
Copy link
Copy Markdown
Member

@samueltardieu samueltardieu commented May 3, 2026

changelog: [needless_return_with_question_mark]: lint more cases when the block in which the return is located has a final expression

Fixes #16958

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

rustbot commented May 3, 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

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 3, 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.

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.

needless_return_with_question_mark FN

3 participants