about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-loop-match.rs
blob: 399b20234f32e3e60d41a47d39dc4300c172e66d (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
25
26
27
28
29
30
// Test that `#[loop_match]` and `#[const_continue]` cannot be used without
// `#![feature(loop_match)]`.

enum State {
    A,
    B,
    C,
}

fn main() {
    let mut state = State::A;
    #[loop_match] //~ ERROR the `#[loop_match]` attribute is an experimental feature
    'a: loop {
        state = 'blk: {
            match state {
                State::A => {
                    #[const_continue]
                    //~^ ERROR the `#[const_continue]` attribute is an experimental feature
                    break 'blk State::B;
                }
                State::B => {
                    #[const_continue]
                    //~^ ERROR the `#[const_continue]` attribute is an experimental feature
                    break 'blk State::C;
                }
                State::C => break 'a,
            }
        };
    }
}