]> git.lizzy.rs Git - rust.git/blob - src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
normalize stderr
[rust.git] / src / test / ui / underscore-lifetime / underscore-lifetime-binders.stderr
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
12 error[E0637]: `'_` cannot be used here
13   --> $DIR/underscore-lifetime-binders.rs:4:8
14    |
15 LL | fn foo<'_>
16    |        ^^ `'_` is a reserved lifetime name
17
18 error[E0637]: `'_` cannot be used here
19   --> $DIR/underscore-lifetime-binders.rs:10:25
20    |
21 LL | fn meh() -> Box<dyn for<'_> Meh<'_>>
22    |                         ^^ `'_` is a reserved lifetime name
23
24 error[E0106]: missing lifetime specifier
25   --> $DIR/underscore-lifetime-binders.rs:10:33
26    |
27 LL | fn meh() -> Box<dyn for<'_> Meh<'_>>
28    |                                 ^^ expected named lifetime parameter
29    |
30    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
31 help: consider using the `'static` lifetime
32    |
33 LL | fn meh() -> Box<dyn for<'_> Meh<'static>>
34    |                                 ~~~~~~~
35
36 error[E0106]: missing lifetime specifier
37   --> $DIR/underscore-lifetime-binders.rs:16:35
38    |
39 LL | fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y }
40    |            ------     ------      ^^ expected named lifetime parameter
41    |
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`
43 help: consider introducing a named lifetime parameter
44    |
45 LL | fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y }
46    |        ++++     ~~         ~~         ~~
47
48 error: aborting due to 5 previous errors
49
50 Some errors have detailed explanations: E0106, E0637.
51 For more information about an error, try `rustc --explain E0106`.