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