mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
22 lines
271 B
Rust
22 lines
271 B
Rust
|
//@ 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!(),
|
||
|
}
|
||
|
}
|