@@ -234,7 +234,13 @@ fn report_elision_failure(
234
234
}
235
235
}
236
236
237
- if !any_lifetimes {
237
+ if len == 0 {
238
+ fileline_help ! ( tcx. sess, default_span,
239
+ "this function's return type contains a borrowed value, but \
240
+ there is no value for it to be borrowed from") ;
241
+ fileline_help ! ( tcx. sess, default_span,
242
+ "consider giving it a 'static lifetime" ) ;
243
+ } else if !any_lifetimes {
238
244
fileline_help ! ( tcx. sess, default_span,
239
245
"this function's return type contains a borrowed value with \
240
246
an elided lifetime, but the lifetime cannot be derived from \
@@ -247,12 +253,6 @@ fn report_elision_failure(
247
253
"this function's return type contains a borrowed value, but \
248
254
the signature does not say which {} it is borrowed from",
249
255
m) ;
250
- } else if len == 0 {
251
- fileline_help ! ( tcx. sess, default_span,
252
- "this function's return type contains a borrowed value, but \
253
- there is no value for it to be borrowed from") ;
254
- fileline_help ! ( tcx. sess, default_span,
255
- "consider giving it a 'static lifetime" ) ;
256
256
} else {
257
257
fileline_help ! ( tcx. sess, default_span,
258
258
"this function's return type contains a borrowed value, but \
0 commit comments