@@ -557,7 +557,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
557
557
// Output the lifetimes fot the first type
558
558
let lifetimes = sub. regions ( )
559
559
. map ( |lifetime| {
560
- let s = format ! ( "{}" , lifetime) ;
560
+ let s = lifetime. to_string ( ) ;
561
561
if s. is_empty ( ) {
562
562
"'_" . to_string ( )
563
563
} else {
@@ -582,7 +582,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
582
582
value. 0 . extend ( ( values. 0 ) . 0 ) ;
583
583
other_value. 0 . extend ( ( values. 1 ) . 0 ) ;
584
584
} else {
585
- value. push_highlighted ( format ! ( "{}" , type_arg) ) ;
585
+ value. push_highlighted ( type_arg. to_string ( ) ) ;
586
586
}
587
587
588
588
if len > 0 && i != len - 1 {
@@ -716,7 +716,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
716
716
mutbl : hir:: Mutability ,
717
717
s : & mut DiagnosticStyledString ,
718
718
) {
719
- let r = & format ! ( "{}" , r ) ;
719
+ let r = & r . to_string ( ) ;
720
720
s. push_highlighted ( format ! (
721
721
"&{}{}{}" ,
722
722
r,
@@ -727,7 +727,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
727
727
""
728
728
}
729
729
) ) ;
730
- s. push_normal ( format ! ( "{}" , ty ) ) ;
730
+ s. push_normal ( ty . to_string ( ) ) ;
731
731
}
732
732
733
733
match ( & t1. sty , & t2. sty ) {
@@ -768,7 +768,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
768
768
}
769
769
770
770
fn lifetime_display ( lifetime : Region ) -> String {
771
- let s = format ! ( "{}" , lifetime) ;
771
+ let s = lifetime. to_string ( ) ;
772
772
if s. is_empty ( ) {
773
773
"'_" . to_string ( )
774
774
} else {
@@ -863,8 +863,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
863
863
// We couldn't find anything in common, highlight everything.
864
864
// let x: Bar<Qux> = y::<Foo<Zar>>();
865
865
(
866
- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t1 ) ) ,
867
- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t2 ) ) ,
866
+ DiagnosticStyledString :: highlighted ( t1 . to_string ( ) ) ,
867
+ DiagnosticStyledString :: highlighted ( t2 . to_string ( ) ) ,
868
868
)
869
869
}
870
870
}
@@ -873,12 +873,12 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
873
873
( & ty:: TyRef ( r1, ref_ty1, mutbl1) , _) if equals ( & ref_ty1, & t2) => {
874
874
let mut values = ( DiagnosticStyledString :: new ( ) , DiagnosticStyledString :: new ( ) ) ;
875
875
push_ty_ref ( & r1, ref_ty1, mutbl1, & mut values. 0 ) ;
876
- values. 1 . push_normal ( format ! ( "{}" , t2 ) ) ;
876
+ values. 1 . push_normal ( t2 . to_string ( ) ) ;
877
877
values
878
878
}
879
879
( _, & ty:: TyRef ( r2, ref_ty2, mutbl2) ) if equals ( & t1, & ref_ty2) => {
880
880
let mut values = ( DiagnosticStyledString :: new ( ) , DiagnosticStyledString :: new ( ) ) ;
881
- values. 0 . push_normal ( format ! ( "{}" , t1 ) ) ;
881
+ values. 0 . push_normal ( t1 . to_string ( ) ) ;
882
882
push_ty_ref ( & r2, ref_ty2, mutbl2, & mut values. 1 ) ;
883
883
values
884
884
}
@@ -902,8 +902,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
902
902
} else {
903
903
// We couldn't find anything in common, highlight everything.
904
904
(
905
- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t1 ) ) ,
906
- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t2 ) ) ,
905
+ DiagnosticStyledString :: highlighted ( t1 . to_string ( ) ) ,
906
+ DiagnosticStyledString :: highlighted ( t2 . to_string ( ) ) ,
907
907
)
908
908
}
909
909
}
@@ -1073,8 +1073,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1073
1073
}
1074
1074
1075
1075
Some ( (
1076
- DiagnosticStyledString :: highlighted ( format ! ( "{}" , exp_found. expected) ) ,
1077
- DiagnosticStyledString :: highlighted ( format ! ( "{}" , exp_found. found) ) ,
1076
+ DiagnosticStyledString :: highlighted ( exp_found. expected . to_string ( ) ) ,
1077
+ DiagnosticStyledString :: highlighted ( exp_found. found . to_string ( ) ) ,
1078
1078
) )
1079
1079
}
1080
1080
0 commit comments