Skip to content

Avoid unreachable_code on required return values#157009

Open
qaijuang wants to merge 2 commits into
rust-lang:mainfrom
qaijuang:unreachable-return-tail
Open

Avoid unreachable_code on required return values#157009
qaijuang wants to merge 2 commits into
rust-lang:mainfrom
qaijuang:unreachable-return-tail

Conversation

@qaijuang
Copy link
Copy Markdown
Contributor

@qaijuang qaijuang commented May 27, 2026

This PR skips return-place assignment plumbing when selecting user code to lint after an uninhabited call.

Fixes #152559

r? cjgillot

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 27, 2026
@qaijuang qaijuang marked this pull request as ready for review May 27, 2026 10:28
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 27, 2026
@cjgillot
Copy link
Copy Markdown
Contributor

cjgillot commented Jun 2, 2026

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 2, 2026

📌 Commit 7451f1d has been approved by cjgillot

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 2, 2026
…r=cjgillot

Avoid `unreachable_code` on required return values

This PR skips return-place assignment plumbing when selecting user code to lint after an uninhabited call.

Fixes rust-lang#152559

r? cjgillot
rust-bors Bot pushed a commit that referenced this pull request Jun 2, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #155418 (transmute: fix check for whether newtypes have equal size)
 - #156603 (Clarify E0381 diagnostics for branch conditions)
 - #156643 (Document run-make external dependencies)
 - #157009 (Avoid `unreachable_code` on required return values)
 - #157308 (make typing mode exhaustive again...)
 - #157312 (disallow most attrs on eiis)
rust-bors Bot pushed a commit that referenced this pull request Jun 2, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #155418 (transmute: fix check for whether newtypes have equal size)
 - #156603 (Clarify E0381 diagnostics for branch conditions)
 - #156643 (Document run-make external dependencies)
 - #157009 (Avoid `unreachable_code` on required return values)
 - #157308 (make typing mode exhaustive again...)
 - #157312 (disallow most attrs on eiis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.92.0 warns about unreachable code, but that code can't be removed without type errors

3 participants