summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/deaggregator_test_enum.rs
blob: ea402dafdec7a8f23cebe29f036f1f05aea64d1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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),
    };
}