Skip to content

Commit

Permalink
Unrolled build for rust-lang#120928
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rust-timer authored Feb 12, 2024
2 parents bdc1592 + 1fa75af commit 43d3b94
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/ui/typeck/issue-116864.rs
Original file line number Diff line number Diff line change
@@ -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() {
}

0 comments on commit 43d3b94

Please sign in to comment.