diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-14865.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-14865.rs b/src/test/ui/issues/issue-14865.rs new file mode 100644 index 000000000..56e78e78f --- /dev/null +++ b/src/test/ui/issues/issue-14865.rs @@ -0,0 +1,23 @@ +// run-pass +#![allow(dead_code)] + +enum X { + Foo(usize), + Bar(bool) +} + +fn main() { + let x = match X::Foo(42) { + X::Foo(..) => 1, + _ if true => 0, + X::Bar(..) => panic!("Oh dear") + }; + assert_eq!(x, 1); + + let x = match X::Foo(42) { + _ if true => 0, + X::Foo(..) => 1, + X::Bar(..) => panic!("Oh dear") + }; + assert_eq!(x, 0); +} |