-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-non_exhaustive`#![feature(non_exhaustive)]``#![feature(non_exhaustive)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
Say I have the following enum in crate b
:
#![feature(non_exhaustive)]
pub enum Enum {
Unit,
#[non_exhaustive] Struct { x: bool }
}
And I match on it in crate a
:
#![deny(unreachable_patterns)]
match Enum::Unit {
Enum::Struct { .. } => {}
Enum::Struct { .. } => {} // This should error but doesn't
_ => {}
}
The second branch is not detected to be unreachable. This is on current nightly; playground link (hacky).
varkor and scottmcm
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-non_exhaustive`#![feature(non_exhaustive)]``#![feature(non_exhaustive)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.