Add test for #[non_exhaustive] enum in match_wildcard_for_single-variant
This commit is contained in:
parent
0b7ab90eca
commit
6cc9cac4bc
2 changed files with 24 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue