mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 17:18:32 +03:00
Add test for #[non_exhaustive] enum in match_wildcard_for_single-variant
This commit is contained in:
@@ -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 => (),
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user