Add test for #[non_exhaustive] enum in match_wildcard_for_single-variant

This commit is contained in:
Jason Newcomb 2021-03-08 10:33:36 -05:00
parent 0b7ab90eca
commit 6cc9cac4bc
No known key found for this signature in database
GPG Key ID: DA59E8643A37ED06
2 changed files with 24 additions and 0 deletions

View File

@ -96,4 +96,16 @@ fn main() {
Some(_) => 1,
_ => 2,
};
#[non_exhaustive]
enum Bar {
A,
B,
C,
}
match Bar::A {
Bar::A => (),
Bar::B => (),
_ => (),
};
}

View File

@ -96,4 +96,16 @@ fn main() {
Some(_) => 1,
_ => 2,
};
#[non_exhaustive]
enum Bar {
A,
B,
C,
}
match Bar::A {
Bar::A => (),
Bar::B => (),
_ => (),
};
}