@@ -222,8 +222,8 @@ impl<'tcx> ty::TyS<'tcx> {
222222 pub fn sort_string ( & self , tcx : TyCtxt < ' _ > ) -> Cow < ' static , str > {
223223 match self . kind {
224224 ty:: Bool | ty:: Char | ty:: Int ( _) |
225- ty:: Uint ( _) | ty:: Float ( _) | ty:: Str | ty:: Never => format ! ( "{} " , self ) . into ( ) ,
226- ty:: Tuple ( ref tys) if tys. is_empty ( ) => format ! ( "{} " , self ) . into ( ) ,
225+ ty:: Uint ( _) | ty:: Float ( _) | ty:: Str | ty:: Never => format ! ( "`{}` " , self ) . into ( ) ,
226+ ty:: Tuple ( ref tys) if tys. is_empty ( ) => format ! ( "`{}` " , self ) . into ( ) ,
227227
228228 ty:: Adt ( def, _) => format ! ( "{} `{}`" , def. descr( ) , tcx. def_path_str( def. did) ) . into ( ) ,
229229 ty:: Foreign ( def_id) => format ! ( "extern type `{}`" , tcx. def_path_str( def_id) ) . into ( ) ,
@@ -244,7 +244,7 @@ impl<'tcx> ty::TyS<'tcx> {
244244 if tymut_string != "_" && (
245245 ty. is_simple_text ( ) || tymut_string. len ( ) < "mutable reference" . len ( )
246246 ) {
247- format ! ( "&{}" , tymut_string) . into ( )
247+ format ! ( "` &{}` " , tymut_string) . into ( )
248248 } else { // Unknown type name, it's long or has type arguments
249249 match mutbl {
250250 hir:: Mutability :: Mutable => "mutable reference" ,
@@ -256,7 +256,7 @@ impl<'tcx> ty::TyS<'tcx> {
256256 ty:: FnPtr ( _) => "fn pointer" . into ( ) ,
257257 ty:: Dynamic ( ref inner, ..) => {
258258 if let Some ( principal) = inner. principal ( ) {
259- format ! ( "trait {} " , tcx. def_path_str( principal. def_id( ) ) ) . into ( )
259+ format ! ( "trait `{}` " , tcx. def_path_str( principal. def_id( ) ) ) . into ( )
260260 } else {
261261 "trait" . into ( )
262262 }
0 commit comments