summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/labeled-no-colon-expr.rs
blob: d9ebd7473bc721dcaf975d7da7fea57924741caf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() {
    'l0 while false {} //~ ERROR labeled expression must be followed by `:`
    'l1 for _ in 0..1 {} //~ ERROR labeled expression must be followed by `:`
    'l2 loop {} //~ ERROR labeled expression must be followed by `:`
    'l3 {} //~ ERROR labeled expression must be followed by `:`
    'l4 0; //~ ERROR labeled expression must be followed by `:`
    //~^ ERROR expected `while`, `for`, `loop` or `{`

    macro_rules! m {
        ($b:block) => {
            'l5 $b; //~ ERROR cannot use a `block` macro fragment here
        }
    }
    m!({}); //~ ERROR labeled expression must be followed by `:`
}