about summary refs log tree commit diff
path: root/tests/ui/async-await/higher-ranked-auto-trait-11.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/higher-ranked-auto-trait-11.rs')
-rw-r--r--tests/ui/async-await/higher-ranked-auto-trait-11.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/async-await/higher-ranked-auto-trait-11.rs b/tests/ui/async-await/higher-ranked-auto-trait-11.rs
new file mode 100644
index 00000000000..3aebdd8224d
--- /dev/null
+++ b/tests/ui/async-await/higher-ranked-auto-trait-11.rs
@@ -0,0 +1,31 @@
+// Repro for <https://github.com/rust-lang/rust/issues/60658#issuecomment-1509321859>.
+//@ edition: 2021
+//@ revisions: assumptions no_assumptions
+//@[assumptions] compile-flags: -Zhigher-ranked-assumptions
+//@[assumptions] known-bug: unknown
+//@[no_assumptions] known-bug: #110338
+
+use core::pin::Pin;
+use std::future::Future;
+
+pub trait Foo<'a> {
+    type Future: Future<Output = ()>;
+
+    fn foo() -> Self::Future;
+}
+
+struct MyType<T>(T);
+
+impl<'a, T> Foo<'a> for MyType<T>
+where
+    T: Foo<'a>,
+    T::Future: Send,
+{
+    type Future = Pin<Box<dyn Future<Output = ()> + Send + 'a>>;
+
+    fn foo() -> Self::Future {
+        Box::pin(async move { <T as Foo<'a>>::foo().await })
+    }
+}
+
+fn main() {}