diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/parser/block-no-opening-brace.rs | 31 | ||||
| -rw-r--r-- | src/test/ui/parser/block-no-opening-brace.stderr | 58 |
2 files changed, 45 insertions, 44 deletions
diff --git a/src/test/ui/parser/block-no-opening-brace.rs b/src/test/ui/parser/block-no-opening-brace.rs index 169625bf897..e4bb39f6836 100644 --- a/src/test/ui/parser/block-no-opening-brace.rs +++ b/src/test/ui/parser/block-no-opening-brace.rs @@ -5,26 +5,27 @@ fn main() {} fn f1() { - loop - let x = 0; //~ ERROR expected `{`, found keyword `let` - } + loop + let x = 0; //~ ERROR expected `{`, found keyword `let` + drop(0); + } fn f2() { - while true - let x = 0; //~ ERROR expected `{`, found keyword `let` - } + while true + let x = 0; //~ ERROR expected `{`, found keyword `let` + } fn f3() { - for x in 0..1 - let x = 0; //~ ERROR expected `{`, found keyword `let` - } + for x in 0..1 + let x = 0; //~ ERROR expected `{`, found keyword `let` + } fn f4() { - try //~ ERROR expected expression, found reserved keyword `try` - let x = 0; - } + try //~ ERROR expected expression, found reserved keyword `try` + let x = 0; + } fn f5() { - async //~ ERROR async closures are unstable - let x = 0; //~ ERROR expected one of `move`, `|`, or `||`, found keyword `let` - } + async //~ ERROR async closures are unstable + let x = 0; //~ ERROR expected one of `move`, `|`, or `||`, found keyword `let` + } diff --git a/src/test/ui/parser/block-no-opening-brace.stderr b/src/test/ui/parser/block-no-opening-brace.stderr index 56db1147360..a88e4ac44cf 100644 --- a/src/test/ui/parser/block-no-opening-brace.stderr +++ b/src/test/ui/parser/block-no-opening-brace.stderr @@ -1,49 +1,49 @@ error: expected `{`, found keyword `let` - --> $DIR/block-no-opening-brace.rs:9:6 + --> $DIR/block-no-opening-brace.rs:9:9 | -LL | let x = 0; - | ^^^------- - | | - | expected `{` - | help: try placing this code inside a block: `{ let x = 0; }` +LL | let x = 0; + | ^^^------- + | | + | expected `{` + | help: try placing this code inside a block: `{ let x = 0; }` error: expected `{`, found keyword `let` - --> $DIR/block-no-opening-brace.rs:14:6 + --> $DIR/block-no-opening-brace.rs:15:9 | -LL | let x = 0; - | ^^^------- - | | - | expected `{` - | help: try placing this code inside a block: `{ let x = 0; }` +LL | let x = 0; + | ^^^------- + | | + | expected `{` + | help: try placing this code inside a block: `{ let x = 0; }` error: expected `{`, found keyword `let` - --> $DIR/block-no-opening-brace.rs:19:6 + --> $DIR/block-no-opening-brace.rs:20:9 | -LL | let x = 0; - | ^^^------- - | | - | expected `{` - | help: try placing this code inside a block: `{ let x = 0; }` +LL | let x = 0; + | ^^^------- + | | + | expected `{` + | help: try placing this code inside a block: `{ let x = 0; }` error: expected expression, found reserved keyword `try` - --> $DIR/block-no-opening-brace.rs:23:4 + --> $DIR/block-no-opening-brace.rs:24:5 | -LL | try - | ^^^ expected expression +LL | try + | ^^^ expected expression error: expected one of `move`, `|`, or `||`, found keyword `let` - --> $DIR/block-no-opening-brace.rs:29:6 + --> $DIR/block-no-opening-brace.rs:30:9 | -LL | async - | - expected one of `move`, `|`, or `||` -LL | let x = 0; - | ^^^ unexpected token +LL | async + | - expected one of `move`, `|`, or `||` +LL | let x = 0; + | ^^^ unexpected token error[E0658]: async closures are unstable - --> $DIR/block-no-opening-brace.rs:28:4 + --> $DIR/block-no-opening-brace.rs:29:5 | -LL | async - | ^^^^^ +LL | async + | ^^^^^ | = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information = help: add `#![feature(async_closure)]` to the crate attributes to enable |
