@@ -1655,7 +1655,7 @@ impl Debug for Statement<'_> {
16551655/// changing or disturbing program state.
16561656#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , HashStable ) ]
16571657pub struct Place < ' tcx > {
1658- pub base : PlaceBase < ' tcx > ,
1658+ pub base : PlaceBase ,
16591659
16601660 /// projection out of a place (access a field, deref a pointer, etc)
16611661 pub projection : & ' tcx List < PlaceElem < ' tcx > > ,
@@ -1664,34 +1664,9 @@ pub struct Place<'tcx> {
16641664impl < ' tcx > rustc_serialize:: UseSpecializedDecodable for Place < ' tcx > { }
16651665
16661666#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable , HashStable ) ]
1667- pub enum PlaceBase < ' tcx > {
1667+ pub enum PlaceBase {
16681668 /// local variable
16691669 Local ( Local ) ,
1670-
1671- /// static or static mut variable
1672- Static ( Box < Static < ' tcx > > ) ,
1673- }
1674-
1675- /// We store the normalized type to avoid requiring normalization when reading MIR
1676- #[ derive(
1677- Clone ,
1678- Debug ,
1679- PartialEq ,
1680- Eq ,
1681- PartialOrd ,
1682- Ord ,
1683- Hash ,
1684- RustcEncodable ,
1685- RustcDecodable ,
1686- HashStable
1687- ) ]
1688- pub struct Static < ' tcx > {
1689- pub ty : Ty < ' tcx > ,
1690- /// The `DefId` of the item this static was declared in. For promoted values, usually, this is
1691- /// the same as the `DefId` of the `mir::Body` containing the `Place` this promoted appears in.
1692- /// However, after inlining, that might no longer be the case as inlined `Place`s are copied
1693- /// into the calling frame.
1694- pub def_id : DefId ,
16951670}
16961671
16971672#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
@@ -1781,7 +1756,7 @@ rustc_index::newtype_index! {
17811756
17821757#[ derive( Clone , Copy , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
17831758pub struct PlaceRef < ' a , ' tcx > {
1784- pub base : & ' a PlaceBase < ' tcx > ,
1759+ pub base : & ' a PlaceBase ,
17851760 pub projection : & ' a [ PlaceElem < ' tcx > ] ,
17861761}
17871762
@@ -1830,7 +1805,7 @@ impl From<Local> for Place<'_> {
18301805 }
18311806}
18321807
1833- impl From < Local > for PlaceBase < ' _ > {
1808+ impl From < Local > for PlaceBase {
18341809 fn from ( local : Local ) -> Self {
18351810 PlaceBase :: Local ( local)
18361811 }
@@ -1921,13 +1896,10 @@ impl Debug for Place<'_> {
19211896 }
19221897}
19231898
1924- impl Debug for PlaceBase < ' _ > {
1899+ impl Debug for PlaceBase {
19251900 fn fmt ( & self , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
19261901 match * self {
19271902 PlaceBase :: Local ( id) => write ! ( fmt, "{:?}" , id) ,
1928- PlaceBase :: Static ( box self :: Static { ty, def_id } ) => {
1929- write ! ( fmt, "({}: {:?})" , ty:: tls:: with( |tcx| tcx. def_path_str( def_id) ) , ty)
1930- }
19311903 }
19321904 }
19331905}
@@ -3000,18 +2972,16 @@ impl<'tcx> TypeFoldable<'tcx> for Place<'tcx> {
30002972 }
30012973}
30022974
3003- impl < ' tcx > TypeFoldable < ' tcx > for PlaceBase < ' tcx > {
2975+ impl < ' tcx > TypeFoldable < ' tcx > for PlaceBase {
30042976 fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
30052977 match self {
30062978 PlaceBase :: Local ( local) => PlaceBase :: Local ( local. fold_with ( folder) ) ,
3007- PlaceBase :: Static ( static_) => PlaceBase :: Static ( static_. fold_with ( folder) ) ,
30082979 }
30092980 }
30102981
30112982 fn super_visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> bool {
30122983 match self {
30132984 PlaceBase :: Local ( local) => local. visit_with ( visitor) ,
3014- PlaceBase :: Static ( static_) => ( * * static_) . visit_with ( visitor) ,
30152985 }
30162986 }
30172987}
@@ -3027,18 +2997,6 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<PlaceElem<'tcx>> {
30272997 }
30282998}
30292999
3030- impl < ' tcx > TypeFoldable < ' tcx > for Static < ' tcx > {
3031- fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
3032- Static { ty : self . ty . fold_with ( folder) , def_id : self . def_id }
3033- }
3034-
3035- fn super_visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> bool {
3036- let Static { ty, def_id : _ } = self ;
3037-
3038- ty. visit_with ( visitor)
3039- }
3040- }
3041-
30423000impl < ' tcx > TypeFoldable < ' tcx > for Rvalue < ' tcx > {
30433001 fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
30443002 use crate :: mir:: Rvalue :: * ;
0 commit comments