This commit is contained in:
Caio 2024-02-11 08:02:32 -03:00
parent 6cc4843512
commit 1fa75af173

View File

@ -0,0 +1,31 @@
// compile-flags: -Znext-solver
// check-pass
// edition: 2021
use std::future::Future;
trait Baz {
type Param;
}
trait FnMutFut<P, R>: FnMut(P) -> Self::Future {
type Future: Future<Output = R>;
}
impl<P, F, FUT, R> FnMutFut<P, R> for F
where
F: FnMut(P) -> FUT,
FUT: Future<Output = R>,
{
type Future = FUT;
}
async fn foo<BAZ>(_: BAZ, mut cb: impl for<'any> FnMutFut<&'any BAZ::Param, ()>)
where
BAZ: Baz<Param = i32>,
{
cb(&1i32).await;
}
fn main() {
}