aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-3046.rs
blob: f0c72a3cef4b11f7ea02e0b7e199af5741999a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
enum Res {
    OK,
    BAD,
}

enum LOption {
    Some(i32),
    None,
}

fn test(v: LOption) -> Res {
    return Res::BAD;
}

fn main() {
    // Should be:
    // test(LOption::Some(2));
    //
    test(LOption(2));
    // { dg-error "expected function, tuple struct or tuple variant, found enum" "" { target *-*-* } .-1 }
}