mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-17 11:05:20 +00:00
Add test for #[non_exhaustive]
enum in match_wildcard_for_single-variant
This commit is contained in:
parent
0b7ab90eca
commit
6cc9cac4bc
@ -96,4 +96,16 @@ fn main() {
|
||||
Some(_) => 1,
|
||||
_ => 2,
|
||||
};
|
||||
|
||||
#[non_exhaustive]
|
||||
enum Bar {
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
}
|
||||
match Bar::A {
|
||||
Bar::A => (),
|
||||
Bar::B => (),
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
|
@ -96,4 +96,16 @@ fn main() {
|
||||
Some(_) => 1,
|
||||
_ => 2,
|
||||
};
|
||||
|
||||
#[non_exhaustive]
|
||||
enum Bar {
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
}
|
||||
match Bar::A {
|
||||
Bar::A => (),
|
||||
Bar::B => (),
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user