@@ -596,19 +596,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
596596 self . suggest_cloning ( err, place_ty, expr, None ) ;
597597 }
598598
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 ( ) ) ;
601600 err. subdiagnostic ( crate :: session_diagnostics:: TypeNoCopy :: Label {
602601 is_partial_move : false ,
603602 ty,
604603 place : & place_desc,
605604 span,
606605 } ) ;
607- if let Some ( path) = path {
608- err. subdiagnostic ( crate :: session_diagnostics:: LongTypePath {
609- path : path. display ( ) . to_string ( ) ,
610- } ) ;
611- }
612606 } else {
613607 binds_to. sort ( ) ;
614608 binds_to. dedup ( ) ;
@@ -635,19 +629,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
635629 self . suggest_cloning ( err, place_ty, expr, Some ( use_spans) ) ;
636630 }
637631
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 ( ) ) ;
640633 err. subdiagnostic ( crate :: session_diagnostics:: TypeNoCopy :: Label {
641634 is_partial_move : false ,
642635 ty,
643636 place : & place_desc,
644637 span : use_span,
645638 } ) ;
646- if let Some ( path) = path {
647- err. subdiagnostic ( crate :: session_diagnostics:: LongTypePath {
648- path : path. display ( ) . to_string ( ) ,
649- } ) ;
650- }
651639
652640 use_spans. args_subdiag ( err, |args_span| {
653641 crate :: session_diagnostics:: CaptureArgLabel :: MoveOutPlace {
@@ -845,19 +833,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
845833 self . suggest_cloning ( err, bind_to. ty , expr, None ) ;
846834 }
847835
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 ( ) ) ;
850837 err. subdiagnostic ( crate :: session_diagnostics:: TypeNoCopy :: Label {
851838 is_partial_move : false ,
852839 ty,
853840 place : place_desc,
854841 span : binding_span,
855842 } ) ;
856- if let Some ( path) = path {
857- err. subdiagnostic ( crate :: session_diagnostics:: LongTypePath {
858- path : path. display ( ) . to_string ( ) ,
859- } ) ;
860- }
861843 }
862844 }
863845
0 commit comments