Rollup merge of #120928 - c410-f3r:tests-tests-tests, r=davidtwco

Add test for recently fixed issue

Adds a test for issue #116864.
This commit is contained in:
Matthias Krüger 2024-02-12 18:04:09 +01:00 committed by GitHub
commit 02c1e3ed07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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() {
}