]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr
Rollup merge of #106946 - dtolnay:hashlinecolumn, 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[E0792]: expected generic type parameter, found `()`
18   --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:20:27
19    |
20 LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
21    |             - this generic parameter must be used with a generic type parameter
22 ...
23 LL | fn my_fun() -> Return<()> {}
24    |                           ^^
25
26 error: aborting due to 2 previous errors
27
28 Some errors have detailed explanations: E0261, E0792.
29 For more information about an error, try `rustc --explain E0261`.