@@ -600,6 +600,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
600600 block,
601601 var,
602602 irrefutable_pat. span ,
603+ false ,
603604 OutsideGuard ,
604605 ScheduleDrops :: Yes ,
605606 ) ;
@@ -629,6 +630,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
629630 block,
630631 var,
631632 irrefutable_pat. span ,
633+ false ,
632634 OutsideGuard ,
633635 ScheduleDrops :: Yes ,
634636 ) ;
@@ -821,6 +823,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
821823 block : BasicBlock ,
822824 var : LocalVarId ,
823825 span : Span ,
826+ is_shorthand : bool ,
824827 for_guard : ForGuard ,
825828 schedule_drop : ScheduleDrops ,
826829 ) -> Place < ' tcx > {
@@ -834,6 +837,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
834837 {
835838 self . schedule_drop ( span, region_scope, local_id, DropKind :: Storage ) ;
836839 }
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+ }
837844 Place :: from ( local_id)
838845 }
839846
@@ -1230,6 +1237,7 @@ struct Binding<'tcx> {
12301237 source : Place < ' tcx > ,
12311238 var_id : LocalVarId ,
12321239 binding_mode : BindingMode ,
1240+ is_shorthand : bool ,
12331241}
12341242
12351243/// Indicates that the type of `source` must be a subtype of the
@@ -2693,6 +2701,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
26932701 block,
26942702 binding. var_id ,
26952703 binding. span ,
2704+ binding. is_shorthand ,
26962705 RefWithinGuard ,
26972706 schedule_drops,
26982707 ) ;
@@ -2709,6 +2718,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
27092718 block,
27102719 binding. var_id ,
27112720 binding. span ,
2721+ binding. is_shorthand ,
27122722 OutsideGuard ,
27132723 schedule_drops,
27142724 ) ;
@@ -2748,6 +2758,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
27482758 block,
27492759 binding. var_id ,
27502760 binding. span ,
2761+ binding. is_shorthand ,
27512762 OutsideGuard ,
27522763 schedule_drops,
27532764 ) ,
@@ -2801,6 +2812,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
28012812 opt_ty_info : None ,
28022813 opt_match_place,
28032814 pat_span,
2815+ introductions : Vec :: new ( ) ,
28042816 } ,
28052817 ) ) ) ) ,
28062818 } ;
0 commit comments