aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/pattern-struct.rs
blob: db242418c1d3d3d4598f451b3bc8b82e706dd409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fn main() {
    enum A {
        B,
        C,
    }

    impl A {
        fn new() {}
    }

    fn bar(foo: A) {
        match foo {
            A::new() => (), 
            // { dg-error "expected tuple struct or tuple variant, found function" "" { target *-*-* } .-1 }
            _ => {}
        }
    }
}