@@ -596,19 +596,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
596
596
self . suggest_cloning ( err, place_ty, expr, None ) ;
597
597
}
598
598
599
- let mut path = None ;
600
- let ty = self . infcx . tcx . short_ty_string ( place_ty, & mut path) ;
599
+ let ty = self . infcx . tcx . short_string ( place_ty, err. long_ty_path ( ) ) ;
601
600
err. subdiagnostic ( crate :: session_diagnostics:: TypeNoCopy :: Label {
602
601
is_partial_move : false ,
603
602
ty,
604
603
place : & place_desc,
605
604
span,
606
605
} ) ;
607
- if let Some ( path) = path {
608
- err. subdiagnostic ( crate :: session_diagnostics:: LongTypePath {
609
- path : path. display ( ) . to_string ( ) ,
610
- } ) ;
611
- }
612
606
} else {
613
607
binds_to. sort ( ) ;
614
608
binds_to. dedup ( ) ;
@@ -635,19 +629,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
635
629
self . suggest_cloning ( err, place_ty, expr, Some ( use_spans) ) ;
636
630
}
637
631
638
- let mut path = None ;
639
- let ty = self . infcx . tcx . short_ty_string ( place_ty, & mut path) ;
632
+ let ty = self . infcx . tcx . short_string ( place_ty, err. long_ty_path ( ) ) ;
640
633
err. subdiagnostic ( crate :: session_diagnostics:: TypeNoCopy :: Label {
641
634
is_partial_move : false ,
642
635
ty,
643
636
place : & place_desc,
644
637
span : use_span,
645
638
} ) ;
646
- if let Some ( path) = path {
647
- err. subdiagnostic ( crate :: session_diagnostics:: LongTypePath {
648
- path : path. display ( ) . to_string ( ) ,
649
- } ) ;
650
- }
651
639
652
640
use_spans. args_subdiag ( err, |args_span| {
653
641
crate :: session_diagnostics:: CaptureArgLabel :: MoveOutPlace {
@@ -845,19 +833,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
845
833
self . suggest_cloning ( err, bind_to. ty , expr, None ) ;
846
834
}
847
835
848
- let mut path = None ;
849
- let ty = self . infcx . tcx . short_ty_string ( bind_to. ty , & mut path) ;
836
+ let ty = self . infcx . tcx . short_string ( bind_to. ty , err. long_ty_path ( ) ) ;
850
837
err. subdiagnostic ( crate :: session_diagnostics:: TypeNoCopy :: Label {
851
838
is_partial_move : false ,
852
839
ty,
853
840
place : place_desc,
854
841
span : binding_span,
855
842
} ) ;
856
- if let Some ( path) = path {
857
- err. subdiagnostic ( crate :: session_diagnostics:: LongTypePath {
858
- path : path. display ( ) . to_string ( ) ,
859
- } ) ;
860
- }
861
843
}
862
844
}
863
845
0 commit comments