summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/bugs/issue-100013.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-associated-types/bugs/issue-100013.rs')
-rw-r--r--tests/ui/generic-associated-types/bugs/issue-100013.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/bugs/issue-100013.rs b/tests/ui/generic-associated-types/bugs/issue-100013.rs
new file mode 100644
index 000000000..973c548d7
--- /dev/null
+++ b/tests/ui/generic-associated-types/bugs/issue-100013.rs
@@ -0,0 +1,35 @@
+// check-fail
+// known-bug: unknown
+// edition: 2021
+
+// We really should accept this, but we need implied bounds between the regions
+// in a generator interior.
+
+pub trait FutureIterator {
+ type Future<'s, 'cx>: Send
+ where
+ 's: 'cx;
+}
+
+fn call<I: FutureIterator>() -> impl Send {
+ async { // a generator checked for autotrait impl `Send`
+ let x = None::<I::Future<'_, '_>>; // a type referencing GAT
+ async {}.await; // a yield point
+ }
+}
+
+fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
+ async { // a generator checked for autotrait impl `Send`
+ let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
+ async {}.await; // a yield point
+ }
+}
+
+fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
+ async { // a generator checked for autotrait impl `Send`
+ let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
+ async {}.await; // a yield point
+ }
+}
+
+fn main() {}