]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/bugs/issue-100013.rs
Rollup merge of #107112 - eltociear:patch-19, r=albertlarsan68
[rust.git] / tests / ui / generic-associated-types / bugs / issue-100013.rs
1 // check-fail
2 // known-bug: unknown
3 // edition: 2021
4
5 // We really should accept this, but we need implied bounds between the regions
6 // in a generator interior.
7
8 pub trait FutureIterator {
9     type Future<'s, 'cx>: Send
10     where
11         's: 'cx;
12 }
13
14 fn call<I: FutureIterator>() -> impl Send {
15     async { // a generator checked for autotrait impl `Send`
16         let x = None::<I::Future<'_, '_>>; // a type referencing GAT
17         async {}.await; // a yield point
18     }
19 }
20
21 fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
22     async { // a generator checked for autotrait impl `Send`
23         let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
24         async {}.await; // a yield point
25     }
26 }
27
28 fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
29     async { // a generator checked for autotrait impl `Send`
30         let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
31         async {}.await; // a yield point
32     }
33 }
34
35 fn main() {}