@@ -279,13 +279,10 @@ impl<'tcx> ty::TyS<'tcx> {
279
279
}
280
280
ty:: FnDef ( ..) => "fn item" . into ( ) ,
281
281
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 ( )
288
284
}
285
+ ty:: Dynamic ( ..) => "trait object" . into ( ) ,
289
286
ty:: Closure ( ..) => "closure" . into ( ) ,
290
287
ty:: Generator ( def_id, ..) => tcx. generator_kind ( def_id) . unwrap ( ) . descr ( ) . into ( ) ,
291
288
ty:: GeneratorWitness ( ..) => "generator witness" . into ( ) ,
@@ -365,20 +362,19 @@ impl<'tcx> TyCtxt<'tcx> {
365
362
// Issue #63167
366
363
db. note ( "distinct uses of `impl Trait` result in different opaque types" ) ;
367
364
}
368
- ( ty:: Float ( _) , ty:: Infer ( ty:: IntVar ( _) ) ) => {
365
+ ( ty:: Float ( _) , ty:: Infer ( ty:: IntVar ( _) ) )
369
366
if let Ok (
370
367
// Issue #53280
371
368
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
+ ) ;
382
378
}
383
379
}
384
380
( ty:: Param ( expected) , ty:: Param ( found) ) => {
0 commit comments