about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-12 18:04:09 +0100
committerGitHub <noreply@github.com>2024-02-12 18:04:09 +0100
commit02c1e3ed07afddfb8fa9394b599764d142d55156 (patch)
treec7c59f7ba457f5e8971204b06ac726f54b8673e0
parentebe36ac81516fe9cc2c4e924f3abfaeb2c14cb3e (diff)
parent1fa75af1737e9bb08d8d9e4b919a93370364ebc5 (diff)
downloadrust-02c1e3ed07afddfb8fa9394b599764d142d55156.tar.gz
rust-02c1e3ed07afddfb8fa9394b599764d142d55156.zip
Rollup merge of #120928 - c410-f3r:tests-tests-tests, r=davidtwco
Add test for recently fixed issue

Adds a test for issue #116864.
-rw-r--r--tests/ui/typeck/issue-116864.rs31
1 files changed, 31 insertions, 0 deletions
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<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() {
+}