aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-2324-1.rs
blob: afce1f3b570c6cc1cc7b10b96e0debe375ba5f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
enum State {
    Succeeded,
    Failed(u32),
}

fn print_on_failure(state: &State) {
    match *state {
        State::Succeeded => (),
        State::Failed => (), // { dg-error "expected unit struct, unit variant or constant, found tuple variant" }
        _ => ()
    }
}

fn main() {
    let b = State::Failed(1);

    print_on_failure(&b);

}