@@ -194,24 +194,18 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
194
194
if !v. 0 . is_empty ( ) {
195
195
span = v. 0 . clone ( ) . into ( ) ;
196
196
for sp in v. 0 {
197
- span. push_span_label (
198
- sp,
199
- "`'static` requirement introduced here" . to_string ( ) ,
200
- ) ;
197
+ span. push_span_label ( sp, "`'static` requirement introduced here" ) ;
201
198
}
202
199
add_label = false ;
203
200
}
204
201
}
205
202
if add_label {
206
203
span. push_span_label (
207
204
fn_decl. output . span ( ) ,
208
- "requirement introduced by this return type" . to_string ( ) ,
205
+ "requirement introduced by this return type" ,
209
206
) ;
210
207
}
211
- span. push_span_label (
212
- cause. span ,
213
- "because of this returned expression" . to_string ( ) ,
214
- ) ;
208
+ span. push_span_label ( cause. span , "because of this returned expression" ) ;
215
209
err. span_note (
216
210
span,
217
211
"`'static` lifetime requirement introduced by the return type" ,
@@ -523,13 +517,11 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
523
517
hir_v. visit_ty ( & self_ty) ;
524
518
for span in & traits {
525
519
let mut multi_span: MultiSpan = vec ! [ * span] . into ( ) ;
526
- multi_span. push_span_label (
527
- * span,
528
- "this has an implicit `'static` lifetime requirement" . to_string ( ) ,
529
- ) ;
520
+ multi_span
521
+ . push_span_label ( * span, "this has an implicit `'static` lifetime requirement" ) ;
530
522
multi_span. push_span_label (
531
523
ident. span ,
532
- "calling this method introduces the `impl`'s 'static` requirement" . to_string ( ) ,
524
+ "calling this method introduces the `impl`'s 'static` requirement" ,
533
525
) ;
534
526
err. span_note ( multi_span, "the used `impl` has a `'static` requirement" ) ;
535
527
err. span_suggestion_verbose (
0 commit comments