]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/label-after-block-like.rs
Rollup merge of #106798 - scottmcm:signum-via-cmp, r=Mark-Simulacrum
[rust.git] / tests / ui / parser / label-after-block-like.rs
1 fn a() {
2     if let () = () 'a {}
3     //~^ ERROR labeled expression must be followed by `:`
4     //~| ERROR expected `{`, found `'a`
5 }
6
7 fn b() {
8     if true 'a {}
9     //~^ ERROR labeled expression must be followed by `:`
10     //~| ERROR expected `{`, found `'a`
11 }
12
13 fn c() {
14     loop 'a {}
15     //~^ ERROR labeled expression must be followed by `:`
16     //~| ERROR expected `{`, found `'a`
17 }
18
19 fn d() {
20     while true 'a {}
21     //~^ ERROR labeled expression must be followed by `:`
22     //~| ERROR expected `{`, found `'a`
23 }
24
25 fn e() {
26     while let () = () 'a {}
27     //~^ ERROR labeled expression must be followed by `:`
28     //~| ERROR expected `{`, found `'a`
29 }
30
31 fn f() {
32     for _ in 0..0 'a {}
33     //~^ ERROR labeled expression must be followed by `:`
34     //~| ERROR expected `{`, found `'a`
35 }
36
37 fn g() {
38     unsafe 'a {}
39     //~^ ERROR labeled expression must be followed by `:`
40     //~| ERROR expected `{`, found `'a`
41 }
42
43 fn main() {}