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() {}