2016-08-04 18:14:33 -05:00
|
|
|
enum Baz {
|
|
|
|
Empty,
|
|
|
|
Foo { x: usize },
|
|
|
|
}
|
|
|
|
|
|
|
|
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),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// END RUST SOURCE
|
2017-11-04 06:27:08 -05:00
|
|
|
// START rustc.bar.Deaggregator.before.mir
|
2016-08-04 18:14:33 -05:00
|
|
|
// bb0: {
|
2017-10-09 22:14:13 -05:00
|
|
|
// StorageLive(_2);
|
2016-09-28 18:22:11 -05:00
|
|
|
// _2 = _1;
|
2017-11-17 10:22:44 -06:00
|
|
|
// _0 = Baz::Foo { x: move _2 };
|
2017-10-09 22:14:13 -05:00
|
|
|
// StorageDead(_2);
|
2016-10-04 12:43:43 -05:00
|
|
|
// return;
|
2016-08-04 18:14:33 -05:00
|
|
|
// }
|
2017-11-04 06:27:08 -05:00
|
|
|
// END rustc.bar.Deaggregator.before.mir
|
|
|
|
// START rustc.bar.Deaggregator.after.mir
|
2016-08-04 18:14:33 -05:00
|
|
|
// bb0: {
|
2017-10-09 22:14:13 -05:00
|
|
|
// StorageLive(_2);
|
2016-09-28 18:22:11 -05:00
|
|
|
// _2 = _1;
|
2017-11-17 10:22:44 -06:00
|
|
|
// ((_0 as Foo).0: usize) = move _2;
|
2016-09-28 18:22:11 -05:00
|
|
|
// discriminant(_0) = 1;
|
2017-10-09 22:14:13 -05:00
|
|
|
// StorageDead(_2);
|
2016-10-04 12:43:43 -05:00
|
|
|
// return;
|
2016-08-04 18:14:33 -05:00
|
|
|
// }
|
2017-11-04 06:27:08 -05:00
|
|
|
// END rustc.bar.Deaggregator.after.mir
|