2019-07-03 06:30:28 +09:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2019-04-28 22:54:06 +09:00
|
|
|
// edition:2018
|
|
|
|
|
|
|
|
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() {
|
2019-05-28 14:46:13 -04:00
|
|
|
let messages: MyStream<dyn FnMut()> = unimplemented!();
|
2019-07-04 00:25:14 +02:00
|
|
|
get_future(messages).await;
|
2019-04-28 22:54:06 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|