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