@@ -579,6 +579,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
579579 block,
580580 var,
581581 irrefutable_pat. span ,
582+ false ,
582583 OutsideGuard ,
583584 ScheduleDrops :: Yes ,
584585 ) ;
@@ -608,6 +609,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
608609 block,
609610 var,
610611 irrefutable_pat. span ,
612+ false ,
611613 OutsideGuard ,
612614 ScheduleDrops :: Yes ,
613615 ) ;
@@ -799,6 +801,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
799801 block : BasicBlock ,
800802 var : LocalVarId ,
801803 span : Span ,
804+ is_shorthand : bool ,
802805 for_guard : ForGuard ,
803806 schedule_drop : ScheduleDrops ,
804807 ) -> Place < ' tcx > {
@@ -812,6 +815,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
812815 {
813816 self . schedule_drop ( span, region_scope, local_id, DropKind :: Storage ) ;
814817 }
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+ }
815822 Place :: from ( local_id)
816823 }
817824
@@ -1217,6 +1224,7 @@ struct Binding<'tcx> {
12171224 source : Place < ' tcx > ,
12181225 var_id : LocalVarId ,
12191226 binding_mode : BindingMode ,
1227+ is_shorthand : bool ,
12201228}
12211229
12221230/// Indicates that the type of `source` must be a subtype of the
@@ -2725,6 +2733,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
27252733 block,
27262734 binding. var_id ,
27272735 binding. span ,
2736+ binding. is_shorthand ,
27282737 RefWithinGuard ,
27292738 ScheduleDrops :: Yes ,
27302739 ) ;
@@ -2742,6 +2751,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
27422751 block,
27432752 binding. var_id ,
27442753 binding. span ,
2754+ binding. is_shorthand ,
27452755 OutsideGuard ,
27462756 ScheduleDrops :: Yes ,
27472757 ) ;
@@ -2775,6 +2785,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
27752785 block,
27762786 binding. var_id ,
27772787 binding. span ,
2788+ binding. is_shorthand ,
27782789 OutsideGuard ,
27792790 schedule_drops,
27802791 ) ;
@@ -2827,6 +2838,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
28272838 opt_ty_info : None ,
28282839 opt_match_place,
28292840 pat_span,
2841+ introductions : Vec :: new ( ) ,
28302842 } ,
28312843 ) ) ) ) ,
28322844 } ;
0 commit comments