]> git.lizzy.rs Git - rust.git/blob - src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
[rust.git] / src / test / ui / late-bound-lifetimes / downgraded_to_early_through_alias.rs
1 // check-pass
2
3 trait Gats<'a> {
4     type Assoc;
5     type Assoc2;
6 }
7
8 trait Trait: for<'a> Gats<'a> {
9     fn foo<'a>(_: &mut <Self as Gats<'a>>::Assoc) -> <Self as Gats<'a>>::Assoc2;
10 }
11
12 impl<'a> Gats<'a> for () {
13     type Assoc = &'a u32;
14     type Assoc2 = ();
15 }
16
17 type GatsAssoc<'a, T> = <T as Gats<'a>>::Assoc;
18 type GatsAssoc2<'a, T> = <T as Gats<'a>>::Assoc2;
19
20 impl Trait for () {
21     fn foo<'a>(_: &mut GatsAssoc<'a, Self>) -> GatsAssoc2<'a, Self> {}
22 }
23
24 fn main() {}