Skip to content

Commit 43d3b94

Browse files
authored
Unrolled build for rust-lang#120928
Rollup merge of rust-lang#120928 - c410-f3r:tests-tests-tests, r=davidtwco Add test for recently fixed issue Adds a test for issue rust-lang#116864.
2 parents bdc1592 + 1fa75af commit 43d3b94

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/ui/typeck/issue-116864.rs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// compile-flags: -Znext-solver
2+
// check-pass
3+
// edition: 2021
4+
5+
use std::future::Future;
6+
7+
trait Baz {
8+
type Param;
9+
}
10+
11+
trait FnMutFut<P, R>: FnMut(P) -> Self::Future {
12+
type Future: Future<Output = R>;
13+
}
14+
15+
impl<P, F, FUT, R> FnMutFut<P, R> for F
16+
where
17+
F: FnMut(P) -> FUT,
18+
FUT: Future<Output = R>,
19+
{
20+
type Future = FUT;
21+
}
22+
23+
async fn foo<BAZ>(_: BAZ, mut cb: impl for<'any> FnMutFut<&'any BAZ::Param, ()>)
24+
where
25+
BAZ: Baz<Param = i32>,
26+
{
27+
cb(&1i32).await;
28+
}
29+
30+
fn main() {
31+
}

0 commit comments

Comments
 (0)