]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/missing-lt-for-hrtb.stderr
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
[rust.git] / tests / ui / suggestions / missing-lt-for-hrtb.stderr
1 error[E0106]: missing lifetime specifiers
2   --> $DIR/missing-lt-for-hrtb.rs:2:32
3    |
4 LL | struct S<'a>(&'a dyn Fn(&X) -> &X);
5    |                         --     ^^ expected named lifetime parameter
6    |                                |
7    |                                expected named lifetime parameter
8    |
9    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from
10 help: consider using the `'a` lifetime
11    |
12 LL | struct S<'a>(&'a dyn Fn(&X) -> &'a X<'a>);
13    |                                 ++  ++++
14
15 error[E0106]: missing lifetime specifiers
16   --> $DIR/missing-lt-for-hrtb.rs:4:40
17    |
18 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
19    |                                 --     ^^ expected named lifetime parameter
20    |                                        |
21    |                                        expected named lifetime parameter
22    |
23    = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from
24 note: these named lifetimes are available to use
25   --> $DIR/missing-lt-for-hrtb.rs:4:10
26    |
27 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &X);
28    |          ^^              ^^
29 help: consider using one of the available lifetimes here
30    |
31 LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &'lifetime X<'lifetime>);
32    |                                         +++++++++  +++++++++++
33
34 error: aborting due to 2 previous errors
35
36 For more information about this error, try `rustc --explain E0106`.