1 error[E0106]: missing lifetime specifier
2 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:2:11
4 LL | fn f() -> &isize {
5 | ^ expected named lifetime parameter
7 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
8 help: consider using the `'static` lifetime
10 LL | fn f() -> &'static isize {
13 error[E0106]: missing lifetime specifier
14 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:7:33
16 LL | fn g(_x: &isize, _y: &isize) -> &isize {
17 | ------ ------ ^ expected named lifetime parameter
19 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_x` or `_y`
20 help: consider introducing a named lifetime parameter
22 LL | fn g<'a>(_x: &'a isize, _y: &'a isize) -> &'a isize {
25 error[E0106]: missing lifetime specifier
26 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:17:19
28 LL | fn h(_x: &Foo) -> &isize {
29 | ---- ^ expected named lifetime parameter
31 = help: this function's return type contains a borrowed value, but the signature does not say which one of `_x`'s 2 lifetimes it is borrowed from
32 help: consider introducing a named lifetime parameter
34 LL | fn h<'a>(_x: &'a Foo<'a>) -> &'a isize {
37 error[E0106]: missing lifetime specifier
38 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:21:20
40 LL | fn i(_x: isize) -> &isize {
41 | ^ expected named lifetime parameter
43 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
44 help: consider using the `'static` lifetime
46 LL | fn i(_x: isize) -> &'static isize {
49 error[E0106]: missing lifetime specifier
50 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:34:24
52 LL | fn j(_x: StaticStr) -> &isize {
53 | ^ expected named lifetime parameter
55 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
56 help: consider using the `'static` lifetime
58 LL | fn j(_x: StaticStr) -> &'static isize {
61 error[E0106]: missing lifetime specifier
62 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:40:49
64 LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
65 | ^ expected named lifetime parameter
67 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
68 help: consider using the `'a` lifetime
70 LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
73 error[E0106]: missing lifetime specifier
74 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:45:37
76 LL | fn l<'a>(_: &'a str, _: &'a str) -> &str { "" }
77 | ------- ------- ^ expected named lifetime parameter
79 = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
80 help: consider using the `'a` lifetime
82 LL | fn l<'a>(_: &'a str, _: &'a str) -> &'a str { "" }
85 error: aborting due to 7 previous errors
87 For more information about this error, try `rustc --explain E0106`.