diff options
Diffstat (limited to 'tests/ui/enum-discriminant/issue-90038.rs')
-rw-r--r-- | tests/ui/enum-discriminant/issue-90038.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/enum-discriminant/issue-90038.rs b/tests/ui/enum-discriminant/issue-90038.rs new file mode 100644 index 000000000..5e98eccd9 --- /dev/null +++ b/tests/ui/enum-discriminant/issue-90038.rs @@ -0,0 +1,21 @@ +// run-pass + +#[repr(u32)] +pub enum Foo { + // Greater than or equal to 2 + A = 2, +} + +pub enum Bar { + A(Foo), + // More than two const variants + B, + C, +} + +fn main() { + match Bar::A(Foo::A) { + Bar::A(_) => (), + _ => unreachable!(), + } +} |