]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/block-no-opening-brace.rs
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, r=cuviper
[rust.git] / tests / ui / parser / block-no-opening-brace.rs
1 // edition:2018
2
3 #![feature(try_blocks)]
4
5 fn main() {}
6
7 fn f1() {
8     loop
9         let x = 0; //~ ERROR expected `{`, found keyword `let`
10         drop(0);
11     }
12
13 fn f2() {
14     while true
15         let x = 0; //~ ERROR expected `{`, found keyword `let`
16     }
17
18 fn f3() {
19     for x in 0..1
20         let x = 0; //~ ERROR expected `{`, found keyword `let`
21     }
22
23 fn f4() {
24     try //~ ERROR expected expression, found reserved keyword `try`
25         let x = 0;
26     }
27
28 fn f5() {
29     async
30         let x = 0; //~ ERROR expected one of `move`, `|`, or `||`, found keyword `let`
31     }