summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/bugs/issue-100013.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/generic-associated-types/bugs/issue-100013.rs')
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-100013.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/bugs/issue-100013.rs b/src/test/ui/generic-associated-types/bugs/issue-100013.rs
new file mode 100644
index 000000000..fc4e47a3b
--- /dev/null
+++ b/src/test/ui/generic-associated-types/bugs/issue-100013.rs
@@ -0,0 +1,39 @@
+// check-fail
+// known-bug
+// 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`
+ //~^ lifetime bound not satisfied
+ 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`
+ //~^ lifetime bound not satisfied
+ let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
+ //~^ lifetime may not live long enough
+ async {}.await; // a yield point
+ }
+}
+
+fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
+ async { // a generator checked for autotrait impl `Send`
+ //~^ lifetime bound not satisfied
+ let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
+ async {}.await; // a yield point
+ }
+}
+
+fn main() {}