From 52356cad4e749dd394d5f7571f4589b9d1430db5 Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Sun, 28 Apr 2019 22:54:06 +0900 Subject: [PATCH] Add test --- src/test/ui/async-with-closure.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/test/ui/async-with-closure.rs diff --git a/src/test/ui/async-with-closure.rs b/src/test/ui/async-with-closure.rs new file mode 100644 index 00000000000..856a778078a --- /dev/null +++ b/src/test/ui/async-with-closure.rs @@ -0,0 +1,26 @@ +// compile-pass +// edition:2018 + +#![feature(async_await, await_macro)] + +trait MyClosure { + type Args; +} + +impl MyClosure for dyn FnMut() -> R +where R: 'static { + type Args = (); +} + +struct MyStream { + x: C::Args, +} + +async fn get_future(_stream: MyStream) {} + +async fn f() { + let messages: MyStream = unimplemented!(); + await!(get_future(messages)); +} + +fn main() {}