Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/test/ui/async-with-closure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// compile-pass
// edition:2018

#![feature(async_await, await_macro)]

trait MyClosure {
type Args;
}

impl<R> MyClosure for dyn FnMut() -> R
where R: 'static {
type Args = ();
}

struct MyStream<C: ?Sized + MyClosure> {
x: C::Args,
}

async fn get_future<C: ?Sized + MyClosure>(_stream: MyStream<C>) {}

async fn f() {
let messages: MyStream<FnMut()> = unimplemented!();
await!(get_future(messages));
}

fn main() {}