1 error[E0106]: missing lifetime specifier
2 --> $DIR/return-elided-lifetime.rs:6:12
4 LL | fn f1() -> &i32 { loop {} }
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 f1() -> &'static i32 { loop {} }
13 error[E0106]: missing lifetime specifiers
14 --> $DIR/return-elided-lifetime.rs:8:14
16 LL | fn f1_() -> (&i32, &i32) { loop {} }
17 | ^ ^ expected named lifetime parameter
19 | expected named lifetime parameter
21 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
22 help: consider using the `'static` lifetime
24 LL | fn f1_() -> (&'static i32, &'static i32) { loop {} }
27 error[E0106]: missing lifetime specifier
28 --> $DIR/return-elided-lifetime.rs:11:26
30 LL | fn f2(a: i32, b: i32) -> &i32 { loop {} }
31 | ^ expected named lifetime parameter
33 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
34 help: consider using the `'static` lifetime
36 LL | fn f2(a: i32, b: i32) -> &'static i32 { loop {} }
39 error[E0106]: missing lifetime specifiers
40 --> $DIR/return-elided-lifetime.rs:13:28
42 LL | fn f2_(a: i32, b: i32) -> (&i32, &i32) { loop {} }
43 | ^ ^ expected named lifetime parameter
45 | expected named lifetime parameter
47 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
48 help: consider using the `'static` lifetime
50 LL | fn f2_(a: i32, b: i32) -> (&'static i32, &'static i32) { loop {} }
53 error[E0106]: missing lifetime specifier
54 --> $DIR/return-elided-lifetime.rs:17:17
56 LL | fn f3(s: &S) -> &i32 { loop {} }
57 | -- ^ expected named lifetime parameter
59 = help: this function's return type contains a borrowed value, but the signature does not say which one of `s`'s 3 lifetimes it is borrowed from
60 help: consider introducing a named lifetime parameter
62 LL | fn f3<'a>(s: &'a S<'a, 'a>) -> &'a i32 { loop {} }
65 error[E0106]: missing lifetime specifiers
66 --> $DIR/return-elided-lifetime.rs:19:26
68 LL | fn f3_(s: &S, t: &S) -> (&i32, &i32) { loop {} }
69 | -- -- ^ ^ expected named lifetime parameter
71 | expected named lifetime parameter
73 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from one of `s`'s 3 lifetimes or one of `t`'s 3 lifetimes
74 help: consider introducing a named lifetime parameter
76 LL | fn f3_<'a>(s: &'a S<'a, 'a>, t: &'a S<'a, 'a>) -> (&'a i32, &'a i32) { loop {} }
77 | ++++ ++ ++++++++ ++ ++++++++ ++ ++
79 error[E0106]: missing lifetime specifier
80 --> $DIR/return-elided-lifetime.rs:22:42
82 LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &i32 { loop {} }
83 | ------- ------- ^ expected named lifetime parameter
85 = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
86 note: these named lifetimes are available to use
87 --> $DIR/return-elided-lifetime.rs:22:7
89 LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &i32 { loop {} }
91 help: consider using one of the available lifetimes here
93 LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &'lifetime i32 { loop {} }
96 error[E0106]: missing lifetime specifiers
97 --> $DIR/return-elided-lifetime.rs:24:44
99 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} }
100 | ------- ------- ^ ^ expected named lifetime parameter
102 | expected named lifetime parameter
104 = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
105 note: these named lifetimes are available to use
106 --> $DIR/return-elided-lifetime.rs:24:8
108 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} }
110 help: consider using one of the available lifetimes here
112 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&'lifetime i32, &'lifetime i32) { loop {} }
113 | +++++++++ +++++++++
115 error[E0106]: missing lifetime specifier
116 --> $DIR/return-elided-lifetime.rs:27:35
118 LL | fn f5<'a>(a: &'a i32, b: &i32) -> &i32 { loop {} }
119 | ------- ---- ^ expected named lifetime parameter
121 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
122 help: consider using the `'a` lifetime
124 LL | fn f5<'a>(a: &'a i32, b: &i32) -> &'a i32 { loop {} }
127 error[E0106]: missing lifetime specifiers
128 --> $DIR/return-elided-lifetime.rs:29:37
130 LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &i32) { loop {} }
131 | ------- ---- ^ ^ expected named lifetime parameter
133 | expected named lifetime parameter
135 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
136 help: consider using the `'a` lifetime
138 LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&'a i32, &'a i32) { loop {} }
141 error: aborting due to 10 previous errors
143 For more information about this error, try `rustc --explain E0106`.