@@ -890,18 +890,11 @@ pub struct Place<'tcx> {
890890 pub projection : & ' tcx List < PlaceElem < ' tcx > > ,
891891}
892892
893- /// The different kinds of projections that can be used in the projection of a `Place`.
894- ///
895- /// `T1` is the generic type for a field projection. For an actual projection on a `Place`
896- /// this parameter will always be `Ty`, but the field type can be unavailable when
897- /// building (by using `PlaceBuilder`) places that correspond to upvars.
898- /// `T2` is the generic type for an `OpaqueCast` (is generic since it's abstracted over
899- /// in dataflow analysis, see `AbstractElem`).
900893#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
901894#[ derive( TyEncodable , TyDecodable , HashStable , TypeFoldable , TypeVisitable ) ]
902- pub enum ProjectionElem < V , T1 , T2 > {
895+ pub enum ProjectionElem < V , T > {
903896 Deref ,
904- Field ( Field , T1 ) ,
897+ Field ( Field , T ) ,
905898 /// Index into a slice/array.
906899 ///
907900 /// Note that this does not also dereference, and so it does not exactly correspond to slice
@@ -957,36 +950,12 @@ pub enum ProjectionElem<V, T1, T2> {
957950
958951 /// Like an explicit cast from an opaque type to a concrete type, but without
959952 /// requiring an intermediate variable.
960- OpaqueCast ( T2 ) ,
953+ OpaqueCast ( T ) ,
961954}
962955
963956/// Alias for projections as they appear in places, where the base is a place
964957/// and the index is a local.
965- pub type PlaceElem < ' tcx > = ProjectionElem < Local , Ty < ' tcx > , Ty < ' tcx > > ;
966-
967- /// Alias for projections that appear in `PlaceBuilder::Upvar`, for which
968- /// we cannot provide any field types.
969- pub type UpvarProjectionElem < ' tcx > = ProjectionElem < Local , ( ) , Ty < ' tcx > > ;
970-
971- impl < ' tcx > From < PlaceElem < ' tcx > > for UpvarProjectionElem < ' tcx > {
972- fn from ( elem : PlaceElem < ' tcx > ) -> Self {
973- match elem {
974- ProjectionElem :: Deref => ProjectionElem :: Deref ,
975- ProjectionElem :: Field ( field, _) => ProjectionElem :: Field ( field, ( ) ) ,
976- ProjectionElem :: Index ( v) => ProjectionElem :: Index ( v) ,
977- ProjectionElem :: ConstantIndex { offset, min_length, from_end } => {
978- ProjectionElem :: ConstantIndex { offset, min_length, from_end }
979- }
980- ProjectionElem :: Subslice { from, to, from_end } => {
981- ProjectionElem :: Subslice { from, to, from_end }
982- }
983- ProjectionElem :: Downcast ( opt_sym, variant_idx) => {
984- ProjectionElem :: Downcast ( opt_sym, variant_idx)
985- }
986- ProjectionElem :: OpaqueCast ( ty) => ProjectionElem :: OpaqueCast ( ty) ,
987- }
988- }
989- }
958+ pub type PlaceElem < ' tcx > = ProjectionElem < Local , Ty < ' tcx > > ;
990959
991960///////////////////////////////////////////////////////////////////////////
992961// Operands
0 commit comments