mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
20 lines
325 B
Rust
20 lines
325 B
Rust
// unit-test: Deaggregator
|
|
|
|
enum Baz {
|
|
Empty,
|
|
Foo { x: usize },
|
|
}
|
|
|
|
// EMIT_MIR deaggregator_test_enum.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),
|
|
};
|
|
}
|