@@ -279,13 +279,10 @@ impl<'tcx> ty::TyS<'tcx> {
279279 }
280280 ty:: FnDef ( ..) => "fn item" . into ( ) ,
281281 ty:: FnPtr ( _) => "fn pointer" . into ( ) ,
282- ty:: Dynamic ( ref inner, ..) => {
283- if let Some ( principal) = inner. principal ( ) {
284- format ! ( "trait object `dyn {}`" , tcx. def_path_str( principal. def_id( ) ) ) . into ( )
285- } else {
286- "trait object" . into ( )
287- }
282+ ty:: Dynamic ( ref inner, ..) if let Some ( principal) = inner. principal ( ) => {
283+ format ! ( "trait object `dyn {}`" , tcx. def_path_str( principal. def_id( ) ) ) . into ( )
288284 }
285+ ty:: Dynamic ( ..) => "trait object" . into ( ) ,
289286 ty:: Closure ( ..) => "closure" . into ( ) ,
290287 ty:: Generator ( def_id, ..) => tcx. generator_kind ( def_id) . unwrap ( ) . descr ( ) . into ( ) ,
291288 ty:: GeneratorWitness ( ..) => "generator witness" . into ( ) ,
@@ -365,20 +362,19 @@ impl<'tcx> TyCtxt<'tcx> {
365362 // Issue #63167
366363 db. note ( "distinct uses of `impl Trait` result in different opaque types" ) ;
367364 }
368- ( ty:: Float ( _) , ty:: Infer ( ty:: IntVar ( _) ) ) => {
365+ ( ty:: Float ( _) , ty:: Infer ( ty:: IntVar ( _) ) )
369366 if let Ok (
370367 // Issue #53280
371368 snippet,
372- ) = self . sess . source_map ( ) . span_to_snippet ( sp)
373- {
374- if snippet. chars ( ) . all ( |c| c. is_digit ( 10 ) || c == '-' || c == '_' ) {
375- db. span_suggestion (
376- sp,
377- "use a float literal" ,
378- format ! ( "{}.0" , snippet) ,
379- MachineApplicable ,
380- ) ;
381- }
369+ ) = self . sess . source_map ( ) . span_to_snippet ( sp) =>
370+ {
371+ if snippet. chars ( ) . all ( |c| c. is_digit ( 10 ) || c == '-' || c == '_' ) {
372+ db. span_suggestion (
373+ sp,
374+ "use a float literal" ,
375+ format ! ( "{}.0" , snippet) ,
376+ MachineApplicable ,
377+ ) ;
382378 }
383379 }
384380 ( ty:: Param ( expected) , ty:: Param ( found) ) => {
0 commit comments