diff options
Diffstat (limited to 'src/test/ui/async-await')
| -rw-r--r-- | src/test/ui/async-await/no-async-const.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/async-await/no-async-const.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/async-await/no-const-async.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/async-await/no-const-async.stderr | 17 | ||||
| -rw-r--r-- | src/test/ui/async-await/no-unsafe-async.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/async-await/no-unsafe-async.stderr | 4 |
6 files changed, 14 insertions, 18 deletions
diff --git a/src/test/ui/async-await/no-async-const.rs b/src/test/ui/async-await/no-async-const.rs index 64322990d0a..963460c1182 100644 --- a/src/test/ui/async-await/no-async-const.rs +++ b/src/test/ui/async-await/no-async-const.rs @@ -2,4 +2,4 @@ // compile-flags: --crate-type lib pub async const fn x() {} -//~^ ERROR expected one of `fn` or `unsafe`, found keyword `const` +//~^ ERROR expected one of `extern`, `fn`, or `unsafe`, found keyword `const` diff --git a/src/test/ui/async-await/no-async-const.stderr b/src/test/ui/async-await/no-async-const.stderr index d5b8b344abe..e324a77187a 100644 --- a/src/test/ui/async-await/no-async-const.stderr +++ b/src/test/ui/async-await/no-async-const.stderr @@ -1,8 +1,8 @@ -error: expected one of `fn` or `unsafe`, found keyword `const` +error: expected one of `extern`, `fn`, or `unsafe`, found keyword `const` --> $DIR/no-async-const.rs:4:11 | LL | pub async const fn x() {} - | ^^^^^ expected one of `fn` or `unsafe` + | ^^^^^ expected one of `extern`, `fn`, or `unsafe` error: aborting due to previous error diff --git a/src/test/ui/async-await/no-const-async.rs b/src/test/ui/async-await/no-const-async.rs index 55b27bd3fa1..b3c59734e03 100644 --- a/src/test/ui/async-await/no-const-async.rs +++ b/src/test/ui/async-await/no-const-async.rs @@ -2,5 +2,4 @@ // compile-flags: --crate-type lib pub const async fn x() {} -//~^ ERROR expected identifier, found keyword `async` -//~^^ expected `:`, found keyword `fn` +//~^ ERROR functions cannot be both `const` and `async` diff --git a/src/test/ui/async-await/no-const-async.stderr b/src/test/ui/async-await/no-const-async.stderr index 62cd5c45d19..f6ae0f1447c 100644 --- a/src/test/ui/async-await/no-const-async.stderr +++ b/src/test/ui/async-await/no-const-async.stderr @@ -1,14 +1,11 @@ -error: expected identifier, found keyword `async` - --> $DIR/no-const-async.rs:4:11 +error: functions cannot be both `const` and `async` + --> $DIR/no-const-async.rs:4:1 | LL | pub const async fn x() {} - | ^^^^^ expected identifier, found keyword + | ^^^^-----^-----^^^^^^^^^^ + | | | + | | `async` because of this + | `const` because of this -error: expected `:`, found keyword `fn` - --> $DIR/no-const-async.rs:4:17 - | -LL | pub const async fn x() {} - | ^^ expected `:` - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/async-await/no-unsafe-async.rs b/src/test/ui/async-await/no-unsafe-async.rs index 1ac1bdffda9..f40154e16f3 100644 --- a/src/test/ui/async-await/no-unsafe-async.rs +++ b/src/test/ui/async-await/no-unsafe-async.rs @@ -8,4 +8,4 @@ impl S { } #[cfg(FALSE)] -unsafe async fn f() {} //~ ERROR expected one of `extern`, `fn`, or `{`, found keyword `async` +unsafe async fn f() {} //~ ERROR expected one of `extern` or `fn`, found keyword `async` diff --git a/src/test/ui/async-await/no-unsafe-async.stderr b/src/test/ui/async-await/no-unsafe-async.stderr index bbeb3427849..2651588d597 100644 --- a/src/test/ui/async-await/no-unsafe-async.stderr +++ b/src/test/ui/async-await/no-unsafe-async.stderr @@ -4,11 +4,11 @@ error: expected one of `extern` or `fn`, found keyword `async` LL | unsafe async fn g() {} | ^^^^^ expected one of `extern` or `fn` -error: expected one of `extern`, `fn`, or `{`, found keyword `async` +error: expected one of `extern` or `fn`, found keyword `async` --> $DIR/no-unsafe-async.rs:11:8 | LL | unsafe async fn f() {} - | ^^^^^ expected one of `extern`, `fn`, or `{` + | ^^^^^ expected one of `extern` or `fn` error: aborting due to 2 previous errors |
