aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/match4.rs
blob: 35b90a64fa5f9933b445cc79dc9daaf3d1334aa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
enum Foo {
    A,
    B,
    C(char),
    D { x: i64, y: i64 },
}

fn inspect(f: Foo) {
    match f {
        Foo::A => {}
        Foo::B => {}
        Foo::C { a } => {}
        // { dg-error "expected struct variant, found tuple variant C" "" { target *-*-* } .-1 }
        Foo::D { x, y } => {}
    }
}