]>
Commit | Line | Data |
---|---|---|
064997fb FG |
1 | error[E0106]: missing lifetime specifier |
2 | --> $DIR/underscore-lifetime-binders.rs:2:17 | |
3 | | | |
4 | LL | struct Baz<'a>(&'_ &'a u8); | |
5 | | ^^ expected named lifetime parameter | |
6 | | | |
7 | help: consider using the `'a` lifetime | |
8 | | | |
9 | LL | struct Baz<'a>(&'a &'a u8); | |
10 | | ~~ | |
11 | ||
0bf4aa26 | 12 | error[E0637]: `'_` cannot be used here |
0731742a | 13 | --> $DIR/underscore-lifetime-binders.rs:4:8 |
b7449926 | 14 | | |
532ac7d7 | 15 | LL | fn foo<'_> |
0bf4aa26 | 16 | | ^^ `'_` is a reserved lifetime name |
b7449926 | 17 | |
0bf4aa26 | 18 | error[E0637]: `'_` cannot be used here |
dc9dc135 | 19 | --> $DIR/underscore-lifetime-binders.rs:10:25 |
b7449926 | 20 | | |
dc9dc135 XL |
21 | LL | fn meh() -> Box<dyn for<'_> Meh<'_>> |
22 | | ^^ `'_` is a reserved lifetime name | |
b7449926 | 23 | |
b7449926 | 24 | error[E0106]: missing lifetime specifier |
dc9dc135 | 25 | --> $DIR/underscore-lifetime-binders.rs:10:33 |
b7449926 | 26 | | |
dc9dc135 | 27 | LL | fn meh() -> Box<dyn for<'_> Meh<'_>> |
f9f354fc | 28 | | ^^ expected named lifetime parameter |
b7449926 XL |
29 | | |
30 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
4b012472 | 31 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values |
f9f354fc XL |
32 | | |
33 | LL | fn meh() -> Box<dyn for<'_> Meh<'static>> | |
94222f64 | 34 | | ~~~~~~~ |
b7449926 XL |
35 | |
36 | error[E0106]: missing lifetime specifier | |
0731742a | 37 | --> $DIR/underscore-lifetime-binders.rs:16:35 |
b7449926 | 38 | | |
532ac7d7 | 39 | LL | fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y } |
74b04a01 | 40 | | ------ ------ ^^ expected named lifetime parameter |
b7449926 | 41 | | |
dc9dc135 | 42 | = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or `y` |
dfeec247 XL |
43 | help: consider introducing a named lifetime parameter |
44 | | | |
74b04a01 | 45 | LL | fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y } |
94222f64 | 46 | | ++++ ~~ ~~ ~~ |
b7449926 | 47 | |
0bf4aa26 | 48 | error: aborting due to 5 previous errors |
b7449926 | 49 | |
74b04a01 XL |
50 | Some errors have detailed explanations: E0106, E0637. |
51 | For more information about an error, try `rustc --explain E0106`. |