]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/missing-lifetime-in-alias.rs
Rollup merge of #100861 - RalfJung:const-ice, r=oli-obk
[rust.git] / src / test / ui / lifetimes / missing-lifetime-in-alias.rs
1 #![feature(generic_associated_types)]
2
3 trait Trait<'a> {
4     type Foo;
5
6     type Bar<'b>
7     //~^ NOTE associated type defined here, with 1 lifetime parameter
8     //~| NOTE
9     where
10         Self: 'b;
11 }
12
13 struct Impl<'a>(&'a ());
14
15 impl<'a> Trait<'a> for Impl<'a> {
16     type Foo = &'a ();
17     type Bar<'b> = &'b ();
18 }
19
20 type A<'a> = Impl<'a>;
21
22 type B<'a> = <A<'a> as Trait>::Foo;
23 //~^ ERROR missing lifetime specifier
24 //~| NOTE expected named lifetime parameter
25
26 type C<'a, 'b> = <A<'a> as Trait>::Bar;
27 //~^ ERROR missing lifetime specifier
28 //~| ERROR missing generics for associated type
29 //~| NOTE expected named lifetime parameter
30 //~| NOTE these named lifetimes are available to use
31 //~| NOTE expected 1 lifetime argument
32
33 fn main() {}