From 25d507f497885cd26f1dba8c8e8158c12d02bd6c Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Tue, 13 Aug 2019 11:27:00 -0700 Subject: review comment: move test --- src/test/ui/async-await/issues/non-async-enclosing-span.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/ui/async-await/issues/non-async-enclosing-span.rs (limited to 'src/test/ui/async-await/issues/non-async-enclosing-span.rs') 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 +} -- cgit 1.4.1-3-g733a5