@@ -882,8 +882,9 @@ pub struct VarBindingForm<'tcx> {
882882 pub opt_match_place : Option < ( Option < Place < ' tcx > > , Span ) > ,
883883 /// The span of the pattern in which this variable was bound.
884884 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 > ,
887888}
888889
889890#[ derive( Clone , Debug , TyEncodable , TyDecodable ) ]
@@ -896,6 +897,14 @@ pub enum BindingForm<'tcx> {
896897 RefForGuard ,
897898}
898899
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+
899908mod binding_form_impl {
900909 use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
901910 use rustc_query_system:: ich:: StableHashingContext ;
0 commit comments