From 1fa75af1737e9bb08d8d9e4b919a93370364ebc5 Mon Sep 17 00:00:00 2001 From: Caio Date: Sun, 11 Feb 2024 08:02:32 -0300 Subject: [PATCH] Add test --- tests/ui/typeck/issue-116864.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/ui/typeck/issue-116864.rs diff --git a/tests/ui/typeck/issue-116864.rs b/tests/ui/typeck/issue-116864.rs new file mode 100644 index 00000000000..88c3f786608 --- /dev/null +++ b/tests/ui/typeck/issue-116864.rs @@ -0,0 +1,31 @@ +// compile-flags: -Znext-solver +// check-pass +// edition: 2021 + +use std::future::Future; + +trait Baz { + type Param; +} + +trait FnMutFut: FnMut(P) -> Self::Future { + type Future: Future; +} + +impl FnMutFut for F +where + F: FnMut(P) -> FUT, + FUT: Future, +{ + type Future = FUT; +} + +async fn foo(_: BAZ, mut cb: impl for<'any> FnMutFut<&'any BAZ::Param, ()>) +where + BAZ: Baz, +{ + cb(&1i32).await; +} + +fn main() { +}