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