@@ -887,15 +887,15 @@ impl_stable_hash_for!(struct Static<'tcx> {
887
887
/// shared between `Constant` and `Lvalue`. See the aliases
888
888
/// `LvalueProjection` etc below.
889
889
#[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
890
- pub struct Projection < ' tcx , B , V > {
890
+ pub struct Projection < ' tcx , B , V , T > {
891
891
pub base : B ,
892
- pub elem : ProjectionElem < ' tcx , V > ,
892
+ pub elem : ProjectionElem < ' tcx , V , T > ,
893
893
}
894
894
895
895
#[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
896
- pub enum ProjectionElem < ' tcx , V > {
896
+ pub enum ProjectionElem < ' tcx , V , T > {
897
897
Deref ,
898
- Field ( Field , Ty < ' tcx > ) ,
898
+ Field ( Field , T ) ,
899
899
Index ( V ) ,
900
900
901
901
/// These indices are generated by slice patterns. Easiest to explain
@@ -932,11 +932,11 @@ pub enum ProjectionElem<'tcx, V> {
932
932
933
933
/// Alias for projections as they appear in lvalues, where the base is an lvalue
934
934
/// 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 > > ;
936
936
937
937
/// Alias for projections as they appear in lvalues, where the base is an lvalue
938
938
/// 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 > > ;
940
940
941
941
newtype_index ! ( Field , "field" ) ;
942
942
@@ -1720,16 +1720,16 @@ impl<'tcx> TypeFoldable<'tcx> for Operand<'tcx> {
1720
1720
}
1721
1721
}
1722
1722
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 >
1725
1725
{
1726
1726
fn super_fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > > ( & self , folder : & mut F ) -> Self {
1727
1727
use mir:: ProjectionElem :: * ;
1728
1728
1729
1729
let base = self . base . fold_with ( folder) ;
1730
1730
let elem = match self . elem {
1731
1731
Deref => Deref ,
1732
- Field ( f, ty) => Field ( f, ty. fold_with ( folder) ) ,
1732
+ Field ( f, ref ty) => Field ( f, ty. fold_with ( folder) ) ,
1733
1733
Index ( ref v) => Index ( v. fold_with ( folder) ) ,
1734
1734
ref elem => elem. clone ( )
1735
1735
} ;
@@ -1745,7 +1745,7 @@ impl<'tcx, B, V> TypeFoldable<'tcx> for Projection<'tcx, B, V>
1745
1745
1746
1746
self . base . visit_with ( visitor) ||
1747
1747
match self . elem {
1748
- Field ( _, ty) => ty. visit_with ( visitor) ,
1748
+ Field ( _, ref ty) => ty. visit_with ( visitor) ,
1749
1749
Index ( ref v) => v. visit_with ( visitor) ,
1750
1750
_ => false
1751
1751
}
0 commit comments