@@ -27,6 +27,7 @@ use syntax::ast::{self, Name};
27
27
use syntax:: symbol:: InternedString ;
28
28
use syntax_pos:: { Span , DUMMY_SP } ;
29
29
use ty:: fold:: { TypeFoldable , TypeFolder , TypeVisitor } ;
30
+ use ty:: List ;
30
31
use ty:: subst:: { Subst , Substs } ;
31
32
use ty:: layout:: VariantIdx ;
32
33
use ty:: {
@@ -1887,6 +1888,7 @@ impl<'tcx> Debug for Statement<'tcx> {
1887
1888
///////////////////////////////////////////////////////////////////////////
1888
1889
// Places
1889
1890
1891
+ /// TODO(csmoe): merge the old Place repr into NeoPlace
1890
1892
/// A path to a value; something that can be evaluated without
1891
1893
/// changing or disturbing program state.
1892
1894
#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
@@ -1904,6 +1906,27 @@ pub enum Place<'tcx> {
1904
1906
Projection ( Box < PlaceProjection < ' tcx > > ) ,
1905
1907
}
1906
1908
1909
+ /// A new Place repr
1910
+ #[ derive( Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1911
+ pub struct NeoPlace < ' tcx > {
1912
+ base : PlaceBase < ' tcx > ,
1913
+ elems : & ' tcx List < PlaceElem < ' tcx > > ,
1914
+ }
1915
+
1916
+ impl < ' tcx > serialize:: UseSpecializedDecodable for & ' tcx List < PlaceElem < ' tcx > > { }
1917
+
1918
+ #[ derive( Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1919
+ pub enum PlaceBase < ' tcx > {
1920
+ /// local variable
1921
+ Local ( Local ) ,
1922
+
1923
+ /// static or static mut variable
1924
+ Static ( Box < Static < ' tcx > > ) ,
1925
+
1926
+ /// Constant code promoted to an injected static
1927
+ Promoted ( Box < ( Promoted , Ty < ' tcx > ) > ) ,
1928
+ }
1929
+
1907
1930
/// The def-id of a static, along with its normalized type (which is
1908
1931
/// stored to avoid requiring normalization when reading MIR).
1909
1932
#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
0 commit comments