]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr
Rollup merge of #103236 - tspiteri:redoc-int-adc-sbb, r=m-ou-se
[rust.git] / tests / ui / type-alias-impl-trait / issue-69136-inner-lifetime-resolve-error.stderr
1 error[E0261]: use of undeclared lifetime name `'a`
2   --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:17:65
3    |
4 LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
5    |                                                                 ^^ undeclared lifetime
6    |
7    = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
8 help: consider making the bound lifetime-generic with a new `'a` lifetime
9    |
10 LL | type Return<A> = impl for<'a> WithAssoc<A, AssocType = impl SomeTrait + 'a>;
11    |                       +++++++
12 help: consider introducing lifetime `'a` here
13    |
14 LL | type Return<'a, A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
15    |             +++
16
17 error: non-defining opaque type use in defining scope
18   --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:20:27
19    |
20 LL | fn my_fun() -> Return<()> {}
21    |                           ^^
22    |
23 note: used non-generic type `()` for generic parameter
24   --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:17:13
25    |
26 LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
27    |             ^
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0261`.