Skip to content

Commit 52356ca

Browse files
committed
Add test
1 parent 938d4ff commit 52356ca

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/test/ui/async-with-closure.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// compile-pass
2+
// edition:2018
3+
4+
#![feature(async_await, await_macro)]
5+
6+
trait MyClosure {
7+
type Args;
8+
}
9+
10+
impl<R> MyClosure for dyn FnMut() -> R
11+
where R: 'static {
12+
type Args = ();
13+
}
14+
15+
struct MyStream<C: ?Sized + MyClosure> {
16+
x: C::Args,
17+
}
18+
19+
async fn get_future<C: ?Sized + MyClosure>(_stream: MyStream<C>) {}
20+
21+
async fn f() {
22+
let messages: MyStream<FnMut()> = unimplemented!();
23+
await!(get_future(messages));
24+
}
25+
26+
fn main() {}

0 commit comments

Comments
 (0)