@@ -884,8 +884,9 @@ pub struct VarBindingForm<'tcx> {
884
884
pub opt_match_place : Option < ( Option < Place < ' tcx > > , Span ) > ,
885
885
/// The span of the pattern in which this variable was bound.
886
886
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 > ,
889
890
}
890
891
891
892
#[ derive( Clone , Debug , TyEncodable , TyDecodable ) ]
@@ -898,6 +899,14 @@ pub enum BindingForm<'tcx> {
898
899
RefForGuard ,
899
900
}
900
901
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
+
901
910
mod binding_form_impl {
902
911
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
903
912
use rustc_query_system:: ich:: StableHashingContext ;
0 commit comments