@@ -887,15 +887,15 @@ impl_stable_hash_for!(struct Static<'tcx> {
887887/// shared between `Constant` and `Lvalue`. See the aliases
888888/// `LvalueProjection` etc below.
889889#[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
890- pub struct Projection < ' tcx , B , V > {
890+ pub struct Projection < ' tcx , B , V , T > {
891891 pub base : B ,
892- pub elem : ProjectionElem < ' tcx , V > ,
892+ pub elem : ProjectionElem < ' tcx , V , T > ,
893893}
894894
895895#[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
896- pub enum ProjectionElem < ' tcx , V > {
896+ pub enum ProjectionElem < ' tcx , V , T > {
897897 Deref ,
898- Field ( Field , Ty < ' tcx > ) ,
898+ Field ( Field , T ) ,
899899 Index ( V ) ,
900900
901901 /// These indices are generated by slice patterns. Easiest to explain
@@ -932,11 +932,11 @@ pub enum ProjectionElem<'tcx, V> {
932932
933933/// Alias for projections as they appear in lvalues, where the base is an lvalue
934934/// and the index is an operand.
935- pub type LvalueProjection < ' tcx > = Projection < ' tcx , Lvalue < ' tcx > , Operand < ' tcx > > ;
935+ pub type LvalueProjection < ' tcx > = Projection < ' tcx , Lvalue < ' tcx > , Operand < ' tcx > , Ty < ' tcx > > ;
936936
937937/// Alias for projections as they appear in lvalues, where the base is an lvalue
938938/// and the index is an operand.
939- pub type LvalueElem < ' tcx > = ProjectionElem < ' tcx , Operand < ' tcx > > ;
939+ pub type LvalueElem < ' tcx > = ProjectionElem < ' tcx , Operand < ' tcx > , Ty < ' tcx > > ;
940940
941941newtype_index ! ( Field , "field" ) ;
942942
@@ -1720,16 +1720,16 @@ impl<'tcx> TypeFoldable<'tcx> for Operand<'tcx> {
17201720 }
17211721}
17221722
1723- impl < ' tcx , B , V > TypeFoldable < ' tcx > for Projection < ' tcx , B , V >
1724- where B : TypeFoldable < ' tcx > , V : TypeFoldable < ' tcx >
1723+ impl < ' tcx , B , V , T > TypeFoldable < ' tcx > for Projection < ' tcx , B , V , T >
1724+ where B : TypeFoldable < ' tcx > , V : TypeFoldable < ' tcx > , T : TypeFoldable < ' tcx >
17251725{
17261726 fn super_fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > > ( & self , folder : & mut F ) -> Self {
17271727 use mir:: ProjectionElem :: * ;
17281728
17291729 let base = self . base . fold_with ( folder) ;
17301730 let elem = match self . elem {
17311731 Deref => Deref ,
1732- Field ( f, ty) => Field ( f, ty. fold_with ( folder) ) ,
1732+ Field ( f, ref ty) => Field ( f, ty. fold_with ( folder) ) ,
17331733 Index ( ref v) => Index ( v. fold_with ( folder) ) ,
17341734 ref elem => elem. clone ( )
17351735 } ;
@@ -1745,7 +1745,7 @@ impl<'tcx, B, V> TypeFoldable<'tcx> for Projection<'tcx, B, V>
17451745
17461746 self . base . visit_with ( visitor) ||
17471747 match self . elem {
1748- Field ( _, ty) => ty. visit_with ( visitor) ,
1748+ Field ( _, ref ty) => ty. visit_with ( visitor) ,
17491749 Index ( ref v) => v. visit_with ( visitor) ,
17501750 _ => false
17511751 }
0 commit comments