-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Emit diagnostic for privately uninhabited uncovered witnesses. #111624
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes might have occurred in exhaustiveness checking cc @Nadrieril |
I'm not very familiar with this code, but the change is diagnostic-only and the output looks reasonable. |
a0b35bd
to
ca4513f
Compare
ca4513f
to
9a7ed36
Compare
@bors r=petrochenkov |
@@ -479,12 +479,30 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> { | |||
AdtDefinedHere { adt_def_span, ty, variants } | |||
}; | |||
|
|||
// Emit an extra note if the first uncovered witness is | |||
// visibly uninhabited anywhere in the current crate. |
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.
It seems like you changed the logic, could you update this comment to match the new logic?
It seems you changed the logic to what I suggested, could you add a test where the secretely uninhabited type is in another crate? |
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#95198 (Add slice::{split_,}{first,last}_chunk{,_mut}) - rust-lang#109899 (Use apple-m1 as target CPU for aarch64-apple-darwin.) - rust-lang#111624 (Emit diagnostic for privately uninhabited uncovered witnesses.) - rust-lang#111875 (Don't leak the function that is called on drop) r? `@ghost` `@rustbot` modify labels: rollup
Correct comment on privately uninhabited pattern. Follow-up to rust-lang#111624 (comment) r? `@Nadrieril`
Fixes #104034
cc @Nadrieril