Skip to content

Commit

Permalink
Rollup merge of rust-lang#60353 - JohnTitor:add-test, r=Centril
Browse files Browse the repository at this point in the history
Add test not to forget resolved ICE

closes rust-lang#55499

I added the example as a test.

r? @pnkfelix
  • Loading branch information
Centril authored Apr 28, 2019
2 parents be6ade5 + 52356ca commit 561f9fc
Showing 1 changed file with 26 additions and 0 deletions.
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() {}

0 comments on commit 561f9fc

Please sign in to comment.