@@ -600,6 +600,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
600
600
block,
601
601
var,
602
602
irrefutable_pat. span ,
603
+ false ,
603
604
OutsideGuard ,
604
605
ScheduleDrops :: Yes ,
605
606
) ;
@@ -629,6 +630,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
629
630
block,
630
631
var,
631
632
irrefutable_pat. span ,
633
+ false ,
632
634
OutsideGuard ,
633
635
ScheduleDrops :: Yes ,
634
636
) ;
@@ -821,6 +823,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
821
823
block : BasicBlock ,
822
824
var : LocalVarId ,
823
825
span : Span ,
826
+ is_shorthand : bool ,
824
827
for_guard : ForGuard ,
825
828
schedule_drop : ScheduleDrops ,
826
829
) -> Place < ' tcx > {
@@ -834,6 +837,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
834
837
{
835
838
self . schedule_drop ( span, region_scope, local_id, DropKind :: Storage ) ;
836
839
}
840
+ let local_info = self . local_decls [ local_id] . local_info . as_mut ( ) . unwrap_crate_local ( ) ;
841
+ if let LocalInfo :: User ( BindingForm :: Var ( var_info) ) = & mut * * local_info {
842
+ var_info. introductions . push ( ( span, is_shorthand) ) ;
843
+ }
837
844
Place :: from ( local_id)
838
845
}
839
846
@@ -1230,6 +1237,7 @@ struct Binding<'tcx> {
1230
1237
source : Place < ' tcx > ,
1231
1238
var_id : LocalVarId ,
1232
1239
binding_mode : BindingMode ,
1240
+ is_shorthand : bool ,
1233
1241
}
1234
1242
1235
1243
/// Indicates that the type of `source` must be a subtype of the
@@ -2693,6 +2701,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2693
2701
block,
2694
2702
binding. var_id ,
2695
2703
binding. span ,
2704
+ binding. is_shorthand ,
2696
2705
RefWithinGuard ,
2697
2706
schedule_drops,
2698
2707
) ;
@@ -2709,6 +2718,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2709
2718
block,
2710
2719
binding. var_id ,
2711
2720
binding. span ,
2721
+ binding. is_shorthand ,
2712
2722
OutsideGuard ,
2713
2723
schedule_drops,
2714
2724
) ;
@@ -2748,6 +2758,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2748
2758
block,
2749
2759
binding. var_id ,
2750
2760
binding. span ,
2761
+ binding. is_shorthand ,
2751
2762
OutsideGuard ,
2752
2763
schedule_drops,
2753
2764
) ,
@@ -2801,6 +2812,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2801
2812
opt_ty_info : None ,
2802
2813
opt_match_place,
2803
2814
pat_span,
2815
+ introductions : Vec :: new ( ) ,
2804
2816
} ,
2805
2817
) ) ) ) ,
2806
2818
} ;
0 commit comments