@@ -557,7 +557,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
557557 // Output the lifetimes fot the first type
558558 let lifetimes = sub. regions ( )
559559 . map ( |lifetime| {
560- let s = format ! ( "{}" , lifetime) ;
560+ let s = lifetime. to_string ( ) ;
561561 if s. is_empty ( ) {
562562 "'_" . to_string ( )
563563 } else {
@@ -582,7 +582,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
582582 value. 0 . extend ( ( values. 0 ) . 0 ) ;
583583 other_value. 0 . extend ( ( values. 1 ) . 0 ) ;
584584 } else {
585- value. push_highlighted ( format ! ( "{}" , type_arg) ) ;
585+ value. push_highlighted ( type_arg. to_string ( ) ) ;
586586 }
587587
588588 if len > 0 && i != len - 1 {
@@ -716,7 +716,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
716716 mutbl : hir:: Mutability ,
717717 s : & mut DiagnosticStyledString ,
718718 ) {
719- let r = & format ! ( "{}" , r ) ;
719+ let r = & r . to_string ( ) ;
720720 s. push_highlighted ( format ! (
721721 "&{}{}{}" ,
722722 r,
@@ -727,7 +727,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
727727 ""
728728 }
729729 ) ) ;
730- s. push_normal ( format ! ( "{}" , ty ) ) ;
730+ s. push_normal ( ty . to_string ( ) ) ;
731731 }
732732
733733 match ( & t1. sty , & t2. sty ) {
@@ -768,7 +768,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
768768 }
769769
770770 fn lifetime_display ( lifetime : Region ) -> String {
771- let s = format ! ( "{}" , lifetime) ;
771+ let s = lifetime. to_string ( ) ;
772772 if s. is_empty ( ) {
773773 "'_" . to_string ( )
774774 } else {
@@ -863,8 +863,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
863863 // We couldn't find anything in common, highlight everything.
864864 // let x: Bar<Qux> = y::<Foo<Zar>>();
865865 (
866- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t1 ) ) ,
867- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t2 ) ) ,
866+ DiagnosticStyledString :: highlighted ( t1 . to_string ( ) ) ,
867+ DiagnosticStyledString :: highlighted ( t2 . to_string ( ) ) ,
868868 )
869869 }
870870 }
@@ -873,12 +873,12 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
873873 ( & ty:: TyRef ( r1, ref_ty1, mutbl1) , _) if equals ( & ref_ty1, & t2) => {
874874 let mut values = ( DiagnosticStyledString :: new ( ) , DiagnosticStyledString :: new ( ) ) ;
875875 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 ( ) ) ;
877877 values
878878 }
879879 ( _, & ty:: TyRef ( r2, ref_ty2, mutbl2) ) if equals ( & t1, & ref_ty2) => {
880880 let mut values = ( DiagnosticStyledString :: new ( ) , DiagnosticStyledString :: new ( ) ) ;
881- values. 0 . push_normal ( format ! ( "{}" , t1 ) ) ;
881+ values. 0 . push_normal ( t1 . to_string ( ) ) ;
882882 push_ty_ref ( & r2, ref_ty2, mutbl2, & mut values. 1 ) ;
883883 values
884884 }
@@ -902,8 +902,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
902902 } else {
903903 // We couldn't find anything in common, highlight everything.
904904 (
905- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t1 ) ) ,
906- DiagnosticStyledString :: highlighted ( format ! ( "{}" , t2 ) ) ,
905+ DiagnosticStyledString :: highlighted ( t1 . to_string ( ) ) ,
906+ DiagnosticStyledString :: highlighted ( t2 . to_string ( ) ) ,
907907 )
908908 }
909909 }
@@ -1073,8 +1073,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
10731073 }
10741074
10751075 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 ( ) ) ,
10781078 ) )
10791079 }
10801080
0 commit comments