]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/construct_with_other_type.rs
Auto merge of #85971 - FabianWolff:issue-85586, r=davidtwco
[rust.git] / src / test / ui / generic-associated-types / construct_with_other_type.rs
1 #![feature(generic_associated_types)]
2
3 // check-pass
4
5 use std::ops::Deref;
6
7 trait Foo {
8     type Bar<'a, 'b>;
9 }
10
11 trait Baz {
12     type Quux<'a>: Foo where Self: 'a;
13
14     // This weird type tests that we can use universal function call syntax to access the Item on
15     type Baa<'a>: Deref<Target = <Self::Quux<'a> as Foo>::Bar<'a, 'static>>  where Self: 'a;
16 }
17
18 impl<T> Baz for T where T: Foo {
19     type Quux<'a> where T: 'a = T;
20
21     type Baa<'a> where T: 'a = &'a <T as Foo>::Bar<'a, 'static>;
22 }
23
24 fn main() {}