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 specifier
14 --> $DIR/return-elided-lifetime.rs:8:14
16 LL | fn f1_() -> (&i32, &i32) { loop {} }
17 | ^ expected named lifetime parameter
19 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
20 help: consider using the `'static` lifetime
22 LL | fn f1_() -> (&'static i32, &i32) { loop {} }
25 error[E0106]: missing lifetime specifier
26 --> $DIR/return-elided-lifetime.rs:8:20
28 LL | fn f1_() -> (&i32, &i32) { loop {} }
29 | ^ expected named lifetime parameter
31 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
32 help: consider using the `'static` lifetime
34 LL | fn f1_() -> (&i32, &'static i32) { loop {} }
37 error[E0106]: missing lifetime specifier
38 --> $DIR/return-elided-lifetime.rs:12:26
40 LL | fn f2(a: i32, b: i32) -> &i32 { loop {} }
41 | ^ expected named lifetime parameter
43 = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
44 help: consider using the `'static` lifetime
46 LL | fn f2(a: i32, b: i32) -> &'static i32 { loop {} }
49 error[E0106]: missing lifetime specifier
50 --> $DIR/return-elided-lifetime.rs:14:28
52 LL | fn f2_(a: i32, b: i32) -> (&i32, &i32) { loop {} }
53 | ^ expected named lifetime parameter
55 = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
56 help: consider using the `'static` lifetime
58 LL | fn f2_(a: i32, b: i32) -> (&'static i32, &i32) { loop {} }
61 error[E0106]: missing lifetime specifier
62 --> $DIR/return-elided-lifetime.rs:14:34
64 LL | fn f2_(a: i32, b: i32) -> (&i32, &i32) { loop {} }
65 | ^ expected named lifetime parameter
67 = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
68 help: consider using the `'static` lifetime
70 LL | fn f2_(a: i32, b: i32) -> (&i32, &'static i32) { loop {} }
73 error[E0106]: missing lifetime specifier
74 --> $DIR/return-elided-lifetime.rs:19:17
76 LL | fn f3(s: &S) -> &i32 { loop {} }
77 | -- ^ expected named lifetime parameter
79 = 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
80 help: consider introducing a named lifetime parameter
82 LL | fn f3<'a>(s: &'a S) -> &'a i32 { loop {} }
85 error[E0106]: missing lifetime specifier
86 --> $DIR/return-elided-lifetime.rs:21:26
88 LL | fn f3_(s: &S, t: &S) -> (&i32, &i32) { loop {} }
89 | -- -- ^ expected named lifetime parameter
91 = 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
92 help: consider introducing a named lifetime parameter
94 LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&'a i32, &i32) { loop {} }
97 error[E0106]: missing lifetime specifier
98 --> $DIR/return-elided-lifetime.rs:21:32
100 LL | fn f3_(s: &S, t: &S) -> (&i32, &i32) { loop {} }
101 | -- -- ^ expected named lifetime parameter
103 = 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
104 help: consider introducing a named lifetime parameter
106 LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&i32, &'a i32) { loop {} }
109 error[E0106]: missing lifetime specifier
110 --> $DIR/return-elided-lifetime.rs:25:42
112 LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &i32 { loop {} }
113 | ------- ------- ^ expected named lifetime parameter
115 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
116 note: these named lifetimes are available to use
117 --> $DIR/return-elided-lifetime.rs:25:7
119 LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &i32 { loop {} }
121 help: consider using one of the available lifetimes here
123 LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &'lifetime i32 { loop {} }
126 error[E0106]: missing lifetime specifier
127 --> $DIR/return-elided-lifetime.rs:27:44
129 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} }
130 | ------- ------- ^ expected named lifetime parameter
132 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
133 note: these named lifetimes are available to use
134 --> $DIR/return-elided-lifetime.rs:27:8
136 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} }
138 help: consider using one of the available lifetimes here
140 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&'lifetime i32, &i32) { loop {} }
143 error[E0106]: missing lifetime specifier
144 --> $DIR/return-elided-lifetime.rs:27:50
146 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} }
147 | ------- ------- ^ expected named lifetime parameter
149 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
150 note: these named lifetimes are available to use
151 --> $DIR/return-elided-lifetime.rs:27:8
153 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &i32) { loop {} }
155 help: consider using one of the available lifetimes here
157 LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &'lifetime i32) { loop {} }
160 error[E0106]: missing lifetime specifier
161 --> $DIR/return-elided-lifetime.rs:31:35
163 LL | fn f5<'a>(a: &'a i32, b: &i32) -> &i32 { loop {} }
164 | ------- ---- ^ expected named lifetime parameter
166 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
167 help: consider using the `'a` lifetime
169 LL | fn f5<'a>(a: &'a i32, b: &i32) -> &'a i32 { loop {} }
172 error[E0106]: missing lifetime specifier
173 --> $DIR/return-elided-lifetime.rs:33:37
175 LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &i32) { loop {} }
176 | ------- ---- ^ expected named lifetime parameter
178 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
179 help: consider using the `'a` lifetime
181 LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&'a i32, &i32) { loop {} }
184 error[E0106]: missing lifetime specifier
185 --> $DIR/return-elided-lifetime.rs:33:43
187 LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &i32) { loop {} }
188 | ------- ---- ^ expected named lifetime parameter
190 = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
191 help: consider using the `'a` lifetime
193 LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &'a i32) { loop {} }
196 error: aborting due to 15 previous errors
198 For more information about this error, try `rustc --explain E0106`.