diff options
Diffstat (limited to 'tests/ui/async-await/generator-desc.rs')
-rw-r--r-- | tests/ui/async-await/generator-desc.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/async-await/generator-desc.rs b/tests/ui/async-await/generator-desc.rs new file mode 100644 index 000000000..500812016 --- /dev/null +++ b/tests/ui/async-await/generator-desc.rs @@ -0,0 +1,16 @@ +// edition:2018 +#![feature(async_closure)] +use std::future::Future; + +async fn one() {} +async fn two() {} + +fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} +fn main() { + fun(async {}, async {}); + //~^ ERROR mismatched types + fun(one(), two()); + //~^ ERROR mismatched types + fun((async || {})(), (async || {})()); + //~^ ERROR mismatched types +} |