diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-15793.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-15793.rs b/src/test/ui/issues/issue-15793.rs new file mode 100644 index 000000000..769012b1b --- /dev/null +++ b/src/test/ui/issues/issue-15793.rs @@ -0,0 +1,27 @@ +// run-pass +#![allow(dead_code)] + +enum NestedEnum { + First, + Second, + Third +} +enum Enum { + Variant1(bool), + Variant2(NestedEnum) +} + +#[inline(never)] +fn foo(x: Enum) -> isize { + match x { + Enum::Variant1(true) => 1, + Enum::Variant1(false) => 2, + Enum::Variant2(NestedEnum::Second) => 3, + Enum::Variant2(NestedEnum::Third) => 4, + Enum::Variant2(NestedEnum::First) => 5 + } +} + +fn main() { + assert_eq!(foo(Enum::Variant2(NestedEnum::Third)), 4); +} |