diff options
Diffstat (limited to 'tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs')
-rw-r--r-- | tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs new file mode 100644 index 000000000..b1fc0f5ad --- /dev/null +++ b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs @@ -0,0 +1,12 @@ +enum A { + B { x: Option<isize> }, + C +} + +fn main() { + let x = A::B { x: Some(3) }; + match x { //~ ERROR non-exhaustive patterns + A::C => {} + A::B { x: None } => {} + } +} |