-
Notifications
You must be signed in to change notification settings - Fork 14.1k
fix the check for which expressions read never type #149545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
70c9a97 to
948d10b
Compare
This comment has been minimized.
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...
948d10b to
4736576
Compare
| // Might not constitute a read, since the condition might be false. | ||
| PatKind::Guard(_, _) => true, |
There was a problem hiding this comment.
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> | |||
There was a problem hiding this comment.
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?
Fixes #149542
Fixes #149431
First commit is a drive-by needed for the refactor of the unreachable code lint, see #148303