Skip to content

Conversation

@Kivooeo
Copy link
Member

@Kivooeo Kivooeo commented Dec 4, 2025

For some reason it works, it checks function output type and suppress warning if type is uninhabited

This double negations in code breaks my mind actually

I'd love to revisit this part in future and try to find a proper solution maybe, but for now I feel like it's enough before release to fix the issue? I really wonder what team does think, especially @cjgillot and other people who are more confident in this part of compiler than I do

I tried a lot of things here, it's only approach that pass all tests included new regression one

fixes #149571

r? compiler

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 4, 2025
@apiraino
Copy link
Contributor

apiraino commented Dec 5, 2025

PR has been just opened so probably still early to evaluate a backport but I'll add the nomination just in case, so we don't overlook this patch - we're getting very close to the release deadline.

Thank you @Kivooeo !

@rustbot label beta-nominated

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 5, 2025
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

r=me after fixing nit

View changes since this review

@rust-cloud-vms rust-cloud-vms bot force-pushed the infallible-type-unreachable-code branch 2 times, most recently from bc43cdc to 7160ae5 Compare December 9, 2025 12:49
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the infallible-type-unreachable-code branch from 7160ae5 to 2a2da78 Compare December 9, 2025 13:18
@Kivooeo
Copy link
Member Author

Kivooeo commented Dec 9, 2025

@bors r=davidtwco

@bors
Copy link
Collaborator

bors commented Dec 9, 2025

📌 Commit 2a2da78 has been approved by davidtwco

It is now in the queue for this repository.

@bors bors 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 Dec 9, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 9, 2025
…e-code, r=davidtwco

attempt to fix unreachable code regression

For some reason it works, it checks function output type and suppress warning if type is uninhabited

~~This double negations in code breaks my mind actually~~

I'd love to revisit this part in future and try to find a proper solution maybe, but for now I feel like it's enough before release to fix the issue? I really wonder what team does think, especially `@cjgillot` and other people who are more confident in this part of compiler than I do

I tried a lot of things here, it's only approach that pass all tests included new regression one

fixes rust-lang#149571

r? compiler
bors added a commit that referenced this pull request Dec 9, 2025
Rollup of 5 pull requests

Successful merges:

 - #144938 (Enable `outline-atomics` by default on more AArch64 platforms)
 - #146579 (Handle macro invocation in attribute during parse)
 - #149400 (unstable proc_macro tracked::* rename/restructure)
 - #149664 (attempt to fix unreachable code regression )
 - #149806 (Mirror `ubuntu:24.04` on ghcr)

Failed merges:

 - #149789 (Cleanup in the attribute parsers)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Dec 9, 2025
Rollup of 5 pull requests

Successful merges:

 - #144938 (Enable `outline-atomics` by default on more AArch64 platforms)
 - #146579 (Handle macro invocation in attribute during parse)
 - #149400 (unstable proc_macro tracked::* rename/restructure)
 - #149664 (attempt to fix unreachable code regression )
 - #149806 (Mirror `ubuntu:24.04` on ghcr)

Failed merges:

 - #149789 (Cleanup in the attribute parsers)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-nominated Nominated for backporting to the compiler in the beta channel. 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.

rustc 1.92.0-beta3 flags unreachable code where there is none

6 participants