@@ -579,6 +579,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
579
579
block,
580
580
var,
581
581
irrefutable_pat. span ,
582
+ false ,
582
583
OutsideGuard ,
583
584
ScheduleDrops :: Yes ,
584
585
) ;
@@ -608,6 +609,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
608
609
block,
609
610
var,
610
611
irrefutable_pat. span ,
612
+ false ,
611
613
OutsideGuard ,
612
614
ScheduleDrops :: Yes ,
613
615
) ;
@@ -799,6 +801,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
799
801
block : BasicBlock ,
800
802
var : LocalVarId ,
801
803
span : Span ,
804
+ is_shorthand : bool ,
802
805
for_guard : ForGuard ,
803
806
schedule_drop : ScheduleDrops ,
804
807
) -> Place < ' tcx > {
@@ -812,6 +815,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
812
815
{
813
816
self . schedule_drop ( span, region_scope, local_id, DropKind :: Storage ) ;
814
817
}
818
+ let local_info = self . local_decls [ local_id] . local_info . as_mut ( ) . unwrap_crate_local ( ) ;
819
+ if let LocalInfo :: User ( BindingForm :: Var ( var_info) ) = & mut * * local_info {
820
+ var_info. introductions . push ( ( span, is_shorthand) ) ;
821
+ }
815
822
Place :: from ( local_id)
816
823
}
817
824
@@ -1217,6 +1224,7 @@ struct Binding<'tcx> {
1217
1224
source : Place < ' tcx > ,
1218
1225
var_id : LocalVarId ,
1219
1226
binding_mode : BindingMode ,
1227
+ is_shorthand : bool ,
1220
1228
}
1221
1229
1222
1230
/// Indicates that the type of `source` must be a subtype of the
@@ -2725,6 +2733,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2725
2733
block,
2726
2734
binding. var_id ,
2727
2735
binding. span ,
2736
+ binding. is_shorthand ,
2728
2737
RefWithinGuard ,
2729
2738
ScheduleDrops :: Yes ,
2730
2739
) ;
@@ -2742,6 +2751,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2742
2751
block,
2743
2752
binding. var_id ,
2744
2753
binding. span ,
2754
+ binding. is_shorthand ,
2745
2755
OutsideGuard ,
2746
2756
ScheduleDrops :: Yes ,
2747
2757
) ;
@@ -2775,6 +2785,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2775
2785
block,
2776
2786
binding. var_id ,
2777
2787
binding. span ,
2788
+ binding. is_shorthand ,
2778
2789
OutsideGuard ,
2779
2790
schedule_drops,
2780
2791
) ;
@@ -2827,6 +2838,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2827
2838
opt_ty_info : None ,
2828
2839
opt_match_place,
2829
2840
pat_span,
2841
+ introductions : Vec :: new ( ) ,
2830
2842
} ,
2831
2843
) ) ) ) ,
2832
2844
} ;
0 commit comments