@@ -882,8 +882,9 @@ pub struct VarBindingForm<'tcx> {
882
882
pub opt_match_place : Option < ( Option < Place < ' tcx > > , Span ) > ,
883
883
/// The span of the pattern in which this variable was bound.
884
884
pub pat_span : Span ,
885
- /// For each introduction place, record here the span and whether this was a shorthand pattern.
886
- pub introductions : Vec < ( Span , /* is_shorthand */ bool ) > ,
885
+ /// A binding can be introduced multiple times, with or patterns:
886
+ /// `Foo::A { x } | Foo::B { z: x }`. This stores information for each of those introductions.
887
+ pub introductions : Vec < VarBindingIntroduction > ,
887
888
}
888
889
889
890
#[ derive( Clone , Debug , TyEncodable , TyDecodable ) ]
@@ -896,6 +897,14 @@ pub enum BindingForm<'tcx> {
896
897
RefForGuard ,
897
898
}
898
899
900
+ #[ derive( Clone , Debug , TyEncodable , TyDecodable , HashStable ) ]
901
+ pub struct VarBindingIntroduction {
902
+ /// Where this additional introduction happened.
903
+ pub span : Span ,
904
+ /// Is that introduction a shorthand struct pattern, i.e. `Foo { x }`.
905
+ pub is_shorthand : bool ,
906
+ }
907
+
899
908
mod binding_form_impl {
900
909
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
901
910
use rustc_query_system:: ich:: StableHashingContext ;
0 commit comments