about summary refs log tree commit diff
path: root/tests/ui/match/enum-and-break-in-match-issue-41213.rs
blob: 7c42a3629c9c0c57c2e854e2027eb61b259043cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ check-pass
#![allow(dead_code)]
enum A {
    A1,
    A2,
    A3,
}

enum B {
    B1(String, String),
    B2(String, String),
}

fn main() {
    let a = A::A1;
    loop {
        let _ctor = match a {
            A::A3 => break,
            A::A1 => B::B1,
            A::A2 => B::B2,
        };
        break;
    }
}