@@ -1663,7 +1663,7 @@ impl Debug for Statement<'_> {
16631663 Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , HashStable ,
16641664) ]
16651665pub struct Place < ' tcx > {
1666- pub base : PlaceBase < ' tcx > ,
1666+ pub base : PlaceBase ,
16671667
16681668 /// projection out of a place (access a field, deref a pointer, etc)
16691669 pub projection : & ' tcx List < PlaceElem < ' tcx > > ,
@@ -1674,24 +1674,9 @@ impl<'tcx> rustc_serialize::UseSpecializedDecodable for Place<'tcx> {}
16741674#[ derive(
16751675 Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable , HashStable ,
16761676) ]
1677- pub enum PlaceBase < ' tcx > {
1677+ pub enum PlaceBase {
16781678 /// local variable
16791679 Local ( Local ) ,
1680-
1681- /// static or static mut variable
1682- Static ( Box < Static < ' tcx > > ) ,
1683- }
1684-
1685- /// We store the normalized type to avoid requiring normalization when reading MIR
1686- #[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ,
1687- RustcEncodable , RustcDecodable , HashStable ) ]
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 ,
16951680}
16961681
16971682#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
@@ -1782,7 +1767,7 @@ rustc_index::newtype_index! {
17821767
17831768#[ derive( Clone , Copy , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
17841769pub struct PlaceRef < ' a , ' tcx > {
1785- pub base : & ' a PlaceBase < ' tcx > ,
1770+ pub base : & ' a PlaceBase ,
17861771 pub projection : & ' a [ PlaceElem < ' tcx > ] ,
17871772}
17881773
@@ -1844,7 +1829,7 @@ impl From<Local> for Place<'_> {
18441829 }
18451830}
18461831
1847- impl From < Local > for PlaceBase < ' _ > {
1832+ impl From < Local > for PlaceBase {
18481833 fn from ( local : Local ) -> Self {
18491834 PlaceBase :: Local ( local)
18501835 }
@@ -1939,13 +1924,10 @@ impl Debug for Place<'_> {
19391924 }
19401925}
19411926
1942- impl Debug for PlaceBase < ' _ > {
1927+ impl Debug for PlaceBase {
19431928 fn fmt ( & self , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
19441929 match * self {
19451930 PlaceBase :: Local ( id) => write ! ( fmt, "{:?}" , id) ,
1946- PlaceBase :: Static ( box self :: Static { ty, def_id } ) => {
1947- write ! ( fmt, "({}: {:?})" , ty:: tls:: with( |tcx| tcx. def_path_str( def_id) ) , ty)
1948- }
19491931 }
19501932 }
19511933}
@@ -3023,18 +3005,16 @@ impl<'tcx> TypeFoldable<'tcx> for Place<'tcx> {
30233005 }
30243006}
30253007
3026- impl < ' tcx > TypeFoldable < ' tcx > for PlaceBase < ' tcx > {
3008+ impl < ' tcx > TypeFoldable < ' tcx > for PlaceBase {
30273009 fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
30283010 match self {
30293011 PlaceBase :: Local ( local) => PlaceBase :: Local ( local. fold_with ( folder) ) ,
3030- PlaceBase :: Static ( static_) => PlaceBase :: Static ( static_. fold_with ( folder) ) ,
30313012 }
30323013 }
30333014
30343015 fn super_visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> bool {
30353016 match self {
30363017 PlaceBase :: Local ( local) => local. visit_with ( visitor) ,
3037- PlaceBase :: Static ( static_) => ( * * static_) . visit_with ( visitor) ,
30383018 }
30393019 }
30403020}
@@ -3050,21 +3030,6 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<PlaceElem<'tcx>> {
30503030 }
30513031}
30523032
3053- impl < ' tcx > TypeFoldable < ' tcx > for Static < ' tcx > {
3054- fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
3055- Static {
3056- ty : self . ty . fold_with ( folder) ,
3057- def_id : self . def_id ,
3058- }
3059- }
3060-
3061- fn super_visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> bool {
3062- let Static { ty, def_id : _ } = self ;
3063-
3064- ty. visit_with ( visitor)
3065- }
3066- }
3067-
30683033impl < ' tcx > TypeFoldable < ' tcx > for Rvalue < ' tcx > {
30693034 fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
30703035 use crate :: mir:: Rvalue :: * ;
0 commit comments