2022-08-02 19:44:25 -05:00
|
|
|
// unit-test: Deaggregator
|
|
|
|
|
2016-08-04 18:14:33 -05:00
|
|
|
enum Baz {
|
|
|
|
Empty,
|
|
|
|
Foo { x: usize },
|
|
|
|
}
|
|
|
|
|
2020-07-27 14:22:43 -05:00
|
|
|
// EMIT_MIR deaggregator_test_enum.bar.Deaggregator.diff
|
2016-08-04 18:14:33 -05:00
|
|
|
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),
|
|
|
|
};
|
|
|
|
}
|