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