diff options
Diffstat (limited to 'tests/ui/async-await/issues/issue-51719.rs')
-rw-r--r-- | tests/ui/async-await/issues/issue-51719.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/async-await/issues/issue-51719.rs b/tests/ui/async-await/issues/issue-51719.rs new file mode 100644 index 000000000..09241f982 --- /dev/null +++ b/tests/ui/async-await/issues/issue-51719.rs @@ -0,0 +1,12 @@ +// edition:2018 +// +// Tests that the .await syntax can't be used to make a generator + +async fn foo() {} + +fn make_generator() { + let _gen = || foo().await; + //~^ ERROR `await` is only allowed inside `async` functions and blocks +} + +fn main() {} |