]> git.proxmox.com Git - rustc.git/blame - tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr
New upstream version 1.76.0+dfsg1
[rustc.git] / tests / ui / underscore-lifetime / underscore-lifetime-binders.stderr
CommitLineData
064997fb
FG
1error[E0106]: missing lifetime specifier
2 --> $DIR/underscore-lifetime-binders.rs:2:17
3 |
4LL | struct Baz<'a>(&'_ &'a u8);
5 | ^^ expected named lifetime parameter
6 |
7help: consider using the `'a` lifetime
8 |
9LL | struct Baz<'a>(&'a &'a u8);
10 | ~~
11
0bf4aa26 12error[E0637]: `'_` cannot be used here
0731742a 13 --> $DIR/underscore-lifetime-binders.rs:4:8
b7449926 14 |
532ac7d7 15LL | fn foo<'_>
0bf4aa26 16 | ^^ `'_` is a reserved lifetime name
b7449926 17
0bf4aa26 18error[E0637]: `'_` cannot be used here
dc9dc135 19 --> $DIR/underscore-lifetime-binders.rs:10:25
b7449926 20 |
dc9dc135
XL
21LL | fn meh() -> Box<dyn for<'_> Meh<'_>>
22 | ^^ `'_` is a reserved lifetime name
b7449926 23
b7449926 24error[E0106]: missing lifetime specifier
dc9dc135 25 --> $DIR/underscore-lifetime-binders.rs:10:33
b7449926 26 |
dc9dc135 27LL | 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 31help: 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 |
33LL | fn meh() -> Box<dyn for<'_> Meh<'static>>
94222f64 34 | ~~~~~~~
b7449926
XL
35
36error[E0106]: missing lifetime specifier
0731742a 37 --> $DIR/underscore-lifetime-binders.rs:16:35
b7449926 38 |
532ac7d7 39LL | 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
43help: consider introducing a named lifetime parameter
44 |
74b04a01 45LL | fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y }
94222f64 46 | ++++ ~~ ~~ ~~
b7449926 47
0bf4aa26 48error: aborting due to 5 previous errors
b7449926 49
74b04a01
XL
50Some errors have detailed explanations: E0106, E0637.
51For more information about an error, try `rustc --explain E0106`.