diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-08-13 11:27:00 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-08-13 11:29:33 -0700 |
| commit | 25d507f497885cd26f1dba8c8e8158c12d02bd6c (patch) | |
| tree | 8b905ea315091dcc48c978f0af48655cc91d57d8 /src/test/ui/async-await/issues/non-async-enclosing-span.rs | |
| parent | 13fd4666b076245e143102e0a43249af0001f7e3 (diff) | |
| download | rust-25d507f497885cd26f1dba8c8e8158c12d02bd6c.tar.gz rust-25d507f497885cd26f1dba8c8e8158c12d02bd6c.zip | |
review comment: move test
Diffstat (limited to 'src/test/ui/async-await/issues/non-async-enclosing-span.rs')
| -rw-r--r-- | src/test/ui/async-await/issues/non-async-enclosing-span.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issues/non-async-enclosing-span.rs b/src/test/ui/async-await/issues/non-async-enclosing-span.rs new file mode 100644 index 00000000000..838911d9b6e --- /dev/null +++ b/src/test/ui/async-await/issues/non-async-enclosing-span.rs @@ -0,0 +1,12 @@ +// edition:2018 +#![feature(async_await)] + +async fn do_the_thing() -> u8 { + 8 +} +// #63398: point at the enclosing scope and not the previously seen closure +fn main() { //~ NOTE this is not `async` + let x = move || {}; + let y = do_the_thing().await; //~ ERROR `await` is only allowed inside `async` functions + //~^ NOTE only allowed inside `async` functions and blocks +} |
