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