summaryrefslogtreecommitdiffstats
path: root/src/test/ui/async-await/await-keyword
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /src/test/ui/async-await/await-keyword
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/async-await/await-keyword')
-rw-r--r--src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs38
-rw-r--r--src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr97
-rw-r--r--src/test/ui/async-await/await-keyword/2015-edition-warning.fixed27
-rw-r--r--src/test/ui/async-await/await-keyword/2015-edition-warning.rs27
-rw-r--r--src/test/ui/async-await/await-keyword/2015-edition-warning.stderr61
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs24
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr81
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error.rs16
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error.stderr63
-rw-r--r--src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs132
-rw-r--r--src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr230
-rw-r--r--src/test/ui/async-await/await-keyword/post_expansion_error.rs10
-rw-r--r--src/test/ui/async-await/await-keyword/post_expansion_error.stderr8
13 files changed, 0 insertions, 814 deletions
diff --git a/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs
deleted file mode 100644
index 50c163999..000000000
--- a/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-#![allow(non_camel_case_types)]
-#![deny(keyword_idents)]
-
-mod outer_mod {
- pub mod await { //~ ERROR `await` is a keyword in the 2018 edition
- //~^ WARN this is accepted in the current edition
- pub struct await; //~ ERROR `await` is a keyword in the 2018 edition
- //~^ WARN this is accepted in the current edition
- }
-}
-use outer_mod::await::await; //~ ERROR `await` is a keyword in the 2018 edition
-//~^ ERROR `await` is a keyword in the 2018 edition
-//~^^ WARN this is accepted in the current edition
-//~^^^ WARN this is accepted in the current edition
-
-struct Foo { await: () }
-//~^ ERROR `await` is a keyword in the 2018 edition
-//~^^ WARN this is accepted in the current edition
-
-impl Foo { fn await() {} }
-//~^ ERROR `await` is a keyword in the 2018 edition
-//~^^ WARN this is accepted in the current edition
-
-macro_rules! await {
-//~^ ERROR `await` is a keyword in the 2018 edition
-//~^^ WARN this is accepted in the current edition
- () => {}
-}
-
-fn main() {
- await!(); //~ ERROR `await` is a keyword in the 2018 edition
- //~^ WARN this is accepted in the current edition
-
- match await { await => {} } //~ ERROR `await` is a keyword in the 2018 edition
- //~^ ERROR `await` is a keyword in the 2018 edition
- //~^^ WARN this is accepted in the current edition
- //~^^^ WARN this is accepted in the current edition
-}
diff --git a/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr
deleted file mode 100644
index d99967eb2..000000000
--- a/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr
+++ /dev/null
@@ -1,97 +0,0 @@
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:5:13
- |
-LL | pub mod await {
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-note: the lint level is defined here
- --> $DIR/2015-edition-error-various-positions.rs:2:9
- |
-LL | #![deny(keyword_idents)]
- | ^^^^^^^^^^^^^^
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:7:20
- |
-LL | pub struct await;
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:11:16
- |
-LL | use outer_mod::await::await;
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:11:23
- |
-LL | use outer_mod::await::await;
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:16:14
- |
-LL | struct Foo { await: () }
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:20:15
- |
-LL | impl Foo { fn await() {} }
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:24:14
- |
-LL | macro_rules! await {
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:31:5
- |
-LL | await!();
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:34:11
- |
-LL | match await { await => {} }
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-error-various-positions.rs:34:19
- |
-LL | match await { await => {} }
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: aborting due to 10 previous errors
-
diff --git a/src/test/ui/async-await/await-keyword/2015-edition-warning.fixed b/src/test/ui/async-await/await-keyword/2015-edition-warning.fixed
deleted file mode 100644
index 117495e13..000000000
--- a/src/test/ui/async-await/await-keyword/2015-edition-warning.fixed
+++ /dev/null
@@ -1,27 +0,0 @@
-// run-rustfix
-
-#![allow(non_camel_case_types)]
-#![deny(keyword_idents)]
-
-mod outer_mod {
- pub mod r#await {
-//~^ ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
- pub struct r#await;
-//~^ ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
- }
-}
-use outer_mod::r#await::r#await;
-//~^ ERROR `await` is a keyword
-//~| ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
-//~| WARN this is accepted in the current edition
-
-fn main() {
- match r#await { r#await => {} }
-//~^ ERROR `await` is a keyword
-//~| ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
-//~| WARN this is accepted in the current edition
-}
diff --git a/src/test/ui/async-await/await-keyword/2015-edition-warning.rs b/src/test/ui/async-await/await-keyword/2015-edition-warning.rs
deleted file mode 100644
index b3c64895c..000000000
--- a/src/test/ui/async-await/await-keyword/2015-edition-warning.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// run-rustfix
-
-#![allow(non_camel_case_types)]
-#![deny(keyword_idents)]
-
-mod outer_mod {
- pub mod await {
-//~^ ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
- pub struct await;
-//~^ ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
- }
-}
-use outer_mod::await::await;
-//~^ ERROR `await` is a keyword
-//~| ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
-//~| WARN this is accepted in the current edition
-
-fn main() {
- match await { await => {} }
-//~^ ERROR `await` is a keyword
-//~| ERROR `await` is a keyword
-//~| WARN this is accepted in the current edition
-//~| WARN this is accepted in the current edition
-}
diff --git a/src/test/ui/async-await/await-keyword/2015-edition-warning.stderr b/src/test/ui/async-await/await-keyword/2015-edition-warning.stderr
deleted file mode 100644
index bf5c4d8d6..000000000
--- a/src/test/ui/async-await/await-keyword/2015-edition-warning.stderr
+++ /dev/null
@@ -1,61 +0,0 @@
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-warning.rs:7:13
- |
-LL | pub mod await {
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-note: the lint level is defined here
- --> $DIR/2015-edition-warning.rs:4:9
- |
-LL | #![deny(keyword_idents)]
- | ^^^^^^^^^^^^^^
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-warning.rs:10:20
- |
-LL | pub struct await;
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-warning.rs:15:16
- |
-LL | use outer_mod::await::await;
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-warning.rs:15:23
- |
-LL | use outer_mod::await::await;
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-warning.rs:22:11
- |
-LL | match await { await => {} }
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: `await` is a keyword in the 2018 edition
- --> $DIR/2015-edition-warning.rs:22:19
- |
-LL | match await { await => {} }
- | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
- |
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
-
-error: aborting due to 6 previous errors
-
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs
deleted file mode 100644
index 9e78f7c51..000000000
--- a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// edition:2018
-
-#![allow(non_camel_case_types)]
-
-mod outer_mod {
- pub mod await { //~ ERROR expected identifier, found keyword `await`
- pub struct await; //~ ERROR expected identifier, found keyword `await`
- }
-}
-use self::outer_mod::await::await; //~ ERROR expected identifier, found keyword `await`
-//~^ ERROR expected identifier, found keyword `await`
-
-struct Foo { await: () }
-//~^ ERROR expected identifier, found keyword `await`
-
-impl Foo { fn await() {} }
-//~^ ERROR expected identifier, found keyword `await`
-
-macro_rules! await {
-//~^ ERROR expected identifier, found keyword `await`
- () => {}
-}
-
-fn main() {}
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
deleted file mode 100644
index 6bd8f671d..000000000
--- a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
+++ /dev/null
@@ -1,81 +0,0 @@
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error-in-non-macro-position.rs:6:13
- |
-LL | pub mod await {
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | pub mod r#await {
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error-in-non-macro-position.rs:7:20
- |
-LL | pub struct await;
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | pub struct r#await;
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error-in-non-macro-position.rs:10:22
- |
-LL | use self::outer_mod::await::await;
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | use self::outer_mod::r#await::await;
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error-in-non-macro-position.rs:10:29
- |
-LL | use self::outer_mod::await::await;
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | use self::outer_mod::await::r#await;
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
- |
-LL | struct Foo { await: () }
- | --- ^^^^^ expected identifier, found keyword
- | |
- | while parsing this struct
- |
-help: escape `await` to use it as an identifier
- |
-LL | struct Foo { r#await: () }
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error-in-non-macro-position.rs:16:15
- |
-LL | impl Foo { fn await() {} }
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | impl Foo { fn r#await() {} }
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error-in-non-macro-position.rs:19:14
- |
-LL | macro_rules! await {
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | macro_rules! r#await {
- | ++
-
-error: aborting due to 7 previous errors
-
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error.rs b/src/test/ui/async-await/await-keyword/2018-edition-error.rs
deleted file mode 100644
index 7ce52259a..000000000
--- a/src/test/ui/async-await/await-keyword/2018-edition-error.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// edition:2018
-#![allow(non_camel_case_types)]
-
-mod outer_mod {
- pub mod await { //~ ERROR expected identifier
- pub struct await; //~ ERROR expected identifier
- }
-}
-use self::outer_mod::await::await; //~ ERROR expected identifier
- //~^ ERROR expected identifier, found keyword `await`
-
-macro_rules! await { () => {}; } //~ ERROR expected identifier, found keyword `await`
-
-fn main() {
- await!(); //~ ERROR expected expression, found `)`
-}
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
deleted file mode 100644
index 34bfdfc71..000000000
--- a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
+++ /dev/null
@@ -1,63 +0,0 @@
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error.rs:5:13
- |
-LL | pub mod await {
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | pub mod r#await {
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error.rs:6:20
- |
-LL | pub struct await;
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | pub struct r#await;
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error.rs:9:22
- |
-LL | use self::outer_mod::await::await;
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | use self::outer_mod::r#await::await;
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error.rs:9:29
- |
-LL | use self::outer_mod::await::await;
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | use self::outer_mod::await::r#await;
- | ++
-
-error: expected identifier, found keyword `await`
- --> $DIR/2018-edition-error.rs:12:14
- |
-LL | macro_rules! await { () => {}; }
- | ^^^^^ expected identifier, found keyword
- |
-help: escape `await` to use it as an identifier
- |
-LL | macro_rules! r#await { () => {}; }
- | ++
-
-error: expected expression, found `)`
- --> $DIR/2018-edition-error.rs:15:12
- |
-LL | await!();
- | ^ expected expression
-
-error: aborting due to 6 previous errors
-
diff --git a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs b/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs
deleted file mode 100644
index 554ac673d..000000000
--- a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs
+++ /dev/null
@@ -1,132 +0,0 @@
-// edition:2018
-
-async fn bar() -> Result<(), ()> {
- Ok(())
-}
-
-async fn foo1() -> Result<(), ()> {
- let _ = await bar(); //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo2() -> Result<(), ()> {
- let _ = await? bar(); //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo3() -> Result<(), ()> {
- let _ = await bar()?; //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo21() -> Result<(), ()> {
- let _ = await { bar() }; //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo22() -> Result<(), ()> {
- let _ = await(bar()); //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo23() -> Result<(), ()> {
- let _ = await { bar() }?; //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo4() -> Result<(), ()> {
- let _ = (await bar())?; //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo5() -> Result<(), ()> {
- let _ = bar().await(); //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo6() -> Result<(), ()> {
- let _ = bar().await()?; //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo7() -> Result<(), ()> {
- let _ = bar().await; // OK
- Ok(())
-}
-async fn foo8() -> Result<(), ()> {
- let _ = bar().await?; // OK
- Ok(())
-}
-fn foo9() -> Result<(), ()> {
- let _ = await bar(); //~ ERROR `await` is only allowed inside `async` functions and blocks
- //~^ ERROR incorrect use of `await`
- Ok(())
-}
-fn foo10() -> Result<(), ()> {
- let _ = await? bar(); //~ ERROR `await` is only allowed inside `async` functions and blocks
- //~^ ERROR incorrect use of `await`
- Ok(())
-}
-fn foo11() -> Result<(), ()> {
- let _ = await bar()?; //~ ERROR incorrect use of `await`
- Ok(())
-}
-fn foo12() -> Result<(), ()> {
- let _ = (await bar())?; //~ ERROR `await` is only allowed inside `async` functions and blocks
- //~^ ERROR incorrect use of `await`
- Ok(())
-}
-fn foo13() -> Result<(), ()> {
- let _ = bar().await(); //~ ERROR `await` is only allowed inside `async` functions and blocks
- //~^ ERROR incorrect use of `await`
- Ok(())
-}
-fn foo14() -> Result<(), ()> {
- let _ = bar().await()?; //~ ERROR `await` is only allowed inside `async` functions and blocks
- //~^ ERROR incorrect use of `await`
- Ok(())
-}
-fn foo15() -> Result<(), ()> {
- let _ = bar().await; //~ ERROR `await` is only allowed inside `async` functions and blocks
- Ok(())
-}
-fn foo16() -> Result<(), ()> {
- let _ = bar().await?; //~ ERROR `await` is only allowed inside `async` functions and blocks
- Ok(())
-}
-fn foo24() -> Result<(), ()> {
- fn foo() -> Result<(), ()> {
- let _ = bar().await?; //~ ERROR `await` is only allowed inside `async` functions and blocks
- Ok(())
- }
- foo()
-}
-fn foo25() -> Result<(), ()> {
- let foo = || {
- let _ = bar().await?; //~ ERROR `await` is only allowed inside `async` functions and blocks
- Ok(())
- };
- foo()
-}
-
-async fn foo26() -> Result<(), ()> {
- let _ = await!(bar()); //~ ERROR incorrect use of `await`
- Ok(())
-}
-async fn foo27() -> Result<(), ()> {
- let _ = await!(bar())?; //~ ERROR incorrect use of `await`
- Ok(())
-}
-fn foo28() -> Result<(), ()> {
- fn foo() -> Result<(), ()> {
- let _ = await!(bar())?; //~ ERROR incorrect use of `await`
- //~^ ERROR `await` is only allowed inside `async` functions
- Ok(())
- }
- foo()
-}
-fn foo29() -> Result<(), ()> {
- let foo = || {
- let _ = await!(bar())?; //~ ERROR incorrect use of `await`
- //~^ ERROR `await` is only allowed inside `async` functions
- Ok(())
- };
- foo()
-}
-
-fn main() {
- match await { await => () }
- //~^ ERROR expected expression, found `=>`
- //~| ERROR incorrect use of `await`
-} //~ ERROR expected one of `.`, `?`, `{`, or an operator, found `}`
diff --git a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr b/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr
deleted file mode 100644
index b30f28837..000000000
--- a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr
+++ /dev/null
@@ -1,230 +0,0 @@
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:8:13
- |
-LL | let _ = await bar();
- | ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:12:13
- |
-LL | let _ = await? bar();
- | ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await?`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:16:13
- |
-LL | let _ = await bar()?;
- | ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:20:13
- |
-LL | let _ = await { bar() };
- | ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:24:13
- |
-LL | let _ = await(bar());
- | ^^^^^^^^^^^^ help: `await` is a postfix operation: `(bar()).await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:28:13
- |
-LL | let _ = await { bar() }?;
- | ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:32:14
- |
-LL | let _ = (await bar())?;
- | ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:36:24
- |
-LL | let _ = bar().await();
- | ^^ help: `await` is not a method call, remove the parentheses
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:40:24
- |
-LL | let _ = bar().await()?;
- | ^^ help: `await` is not a method call, remove the parentheses
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:52:13
- |
-LL | let _ = await bar();
- | ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:57:13
- |
-LL | let _ = await? bar();
- | ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await?`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:62:13
- |
-LL | let _ = await bar()?;
- | ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:66:14
- |
-LL | let _ = (await bar())?;
- | ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:71:24
- |
-LL | let _ = bar().await();
- | ^^ help: `await` is not a method call, remove the parentheses
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:76:24
- |
-LL | let _ = bar().await()?;
- | ^^ help: `await` is not a method call, remove the parentheses
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:104:13
- |
-LL | let _ = await!(bar());
- | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:108:13
- |
-LL | let _ = await!(bar())?;
- | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:113:17
- |
-LL | let _ = await!(bar())?;
- | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:121:17
- |
-LL | let _ = await!(bar())?;
- | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
-
-error: expected expression, found `=>`
- --> $DIR/incorrect-syntax-suggestions.rs:129:25
- |
-LL | match await { await => () }
- | ----- ^^ expected expression
- | |
- | while parsing this incorrect await expression
-
-error: incorrect use of `await`
- --> $DIR/incorrect-syntax-suggestions.rs:129:11
- |
-LL | match await { await => () }
- | ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`
-
-error: expected one of `.`, `?`, `{`, or an operator, found `}`
- --> $DIR/incorrect-syntax-suggestions.rs:132:1
- |
-LL | match await { await => () }
- | ----- - expected one of `.`, `?`, `{`, or an operator
- | |
- | while parsing this `match` expression
-...
-LL | }
- | ^ unexpected token
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:52:13
- |
-LL | fn foo9() -> Result<(), ()> {
- | ---- this is not `async`
-LL | let _ = await bar();
- | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:57:13
- |
-LL | fn foo10() -> Result<(), ()> {
- | ----- this is not `async`
-LL | let _ = await? bar();
- | ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:66:14
- |
-LL | fn foo12() -> Result<(), ()> {
- | ----- this is not `async`
-LL | let _ = (await bar())?;
- | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:71:18
- |
-LL | fn foo13() -> Result<(), ()> {
- | ----- this is not `async`
-LL | let _ = bar().await();
- | ^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:76:18
- |
-LL | fn foo14() -> Result<(), ()> {
- | ----- this is not `async`
-LL | let _ = bar().await()?;
- | ^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:81:18
- |
-LL | fn foo15() -> Result<(), ()> {
- | ----- this is not `async`
-LL | let _ = bar().await;
- | ^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:85:18
- |
-LL | fn foo16() -> Result<(), ()> {
- | ----- this is not `async`
-LL | let _ = bar().await?;
- | ^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:90:22
- |
-LL | fn foo() -> Result<(), ()> {
- | --- this is not `async`
-LL | let _ = bar().await?;
- | ^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:97:22
- |
-LL | let foo = || {
- | -- this is not `async`
-LL | let _ = bar().await?;
- | ^^^^^^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:113:29
- |
-LL | fn foo() -> Result<(), ()> {
- | --- this is not `async`
-LL | let _ = await!(bar())?;
- | ^ only allowed inside `async` functions and blocks
-
-error[E0728]: `await` is only allowed inside `async` functions and blocks
- --> $DIR/incorrect-syntax-suggestions.rs:121:29
- |
-LL | let foo = || {
- | -- this is not `async`
-LL | let _ = await!(bar())?;
- | ^ only allowed inside `async` functions and blocks
-
-error: aborting due to 33 previous errors
-
-For more information about this error, try `rustc --explain E0728`.
diff --git a/src/test/ui/async-await/await-keyword/post_expansion_error.rs b/src/test/ui/async-await/await-keyword/post_expansion_error.rs
deleted file mode 100644
index b4c899b0d..000000000
--- a/src/test/ui/async-await/await-keyword/post_expansion_error.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// edition:2018
-
-macro_rules! r#await {
- () => { println!("Hello, world!") }
-}
-
-fn main() {
- await!()
- //~^ ERROR expected expression, found `)`
-}
diff --git a/src/test/ui/async-await/await-keyword/post_expansion_error.stderr b/src/test/ui/async-await/await-keyword/post_expansion_error.stderr
deleted file mode 100644
index 0996c38b3..000000000
--- a/src/test/ui/async-await/await-keyword/post_expansion_error.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: expected expression, found `)`
- --> $DIR/post_expansion_error.rs:8:12
- |
-LL | await!()
- | ^ expected expression
-
-error: aborting due to previous error
-