Skip to content

Conversation

@WaffleLapkin
Copy link
Member

@WaffleLapkin WaffleLapkin commented Dec 2, 2025

Fixes #149542
Fixes #149431

First commit is a drive-by needed for the refactor of the unreachable code lint, see #148303

@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 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 2, 2025

r? @jackh726

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

@WaffleLapkin WaffleLapkin added the F-never_type `#![feature(never_type)]` label Dec 2, 2025
@rust-log-analyzer

This comment has been minimized.

@WaffleLapkin WaffleLapkin added the F-type_ascription `#![feature(type_ascription)]` label Dec 2, 2025
@rust-log-analyzer

This comment has been minimized.

…ed_to_constitute_read_for_never` to more accessible locations
...wrt `type_ascribe`/unsafe binders -- the check was infinitely
recursive before.
... since unreachable-code only has a few tests while
`reachable` is the more popular directory...
Comment on lines +1810 to +1811
// Might not constitute a read, since the condition might be false.
PatKind::Guard(_, _) => true,
Copy link
Member

Choose a reason for hiding this comment

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

A drive-by thought: this comment doesn't seem to match the function? From the comment, the expectation is false, given the function is guaranteed but this comment just it's not guaranteed.

@@ -0,0 +1,17 @@
// Regression test for <https://github.com/rust-lang/rust/issues/149431>
Copy link
Member

Choose a reason for hiding this comment

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

In the previous commit, you moved tests from unreachable-code to reachable, but this test is in unreachable-code?

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

Labels

F-never_type `#![feature(never_type)]` F-type_ascription `#![feature(type_ascription)]` 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustc crashes when trying to check if nested type_ascription constitutes a read of never type ascription: stack overflow

4 participants