rust/src/test/mir-opt/deaggregator_test_enum.rs

18 lines
280 B
Rust
Raw Normal View History

enum Baz {
Empty,
Foo { x: usize },
}
2020-04-02 16:09:01 -05:00
// EMIT_MIR rustc.bar.Deaggregator.diff
fn bar(a: usize) -> Baz {
Baz::Foo { x: a }
}
fn main() {
let x = bar(10);
match x {
Baz::Empty => println!("empty"),
Baz::Foo { x } => println!("{}", x),
};
}