rust/tests/ui/enum-discriminant/issue-90038.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
271 B
Rust
Raw Normal View History

//@ run-pass
2021-10-19 00:42:44 -05:00
#[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!(),
}
}