From d53d7f77a0edf8d74b0c2483b0aa5d65964a2889 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 10 Aug 2019 18:38:41 +0200 Subject: [PATCH] err on all-but-B, not just on C --- tests/run-pass/enums.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/run-pass/enums.rs b/tests/run-pass/enums.rs index 73172d6bbd2..dab3e873668 100644 --- a/tests/run-pass/enums.rs +++ b/tests/run-pass/enums.rs @@ -40,8 +40,9 @@ fn discriminant_overflow() { } let x = Foo::B; - if let Foo::C(_) = x { - panic!(); + match x { + Foo::B => {}, + _ => panic!(), } }