@@ -641,14 +641,14 @@ pub enum TerminatorKind<'tcx> {
641641 /// Indicates a terminator that can never be reached.
642642 Unreachable ,
643643
644- /// Drop the Lvalue
644+ /// Drop the Place
645645 Drop {
646- location : Lvalue < ' tcx > ,
646+ location : Place < ' tcx > ,
647647 target : BasicBlock ,
648648 unwind : Option < BasicBlock >
649649 } ,
650650
651- /// Drop the Lvalue and assign the new value over it. This ensures
651+ /// Drop the Place and assign the new value over it. This ensures
652652 /// that the assignment to LV occurs *even if* the destructor for
653653 /// lvalue unwinds. Its semantics are best explained by by the
654654 /// elaboration:
@@ -675,7 +675,7 @@ pub enum TerminatorKind<'tcx> {
675675 /// }
676676 /// ```
677677 DropAndReplace {
678- location : Lvalue < ' tcx > ,
678+ location : Place < ' tcx > ,
679679 value : Operand < ' tcx > ,
680680 target : BasicBlock ,
681681 unwind : Option < BasicBlock > ,
@@ -691,7 +691,7 @@ pub enum TerminatorKind<'tcx> {
691691 /// reused across function calls without duplicating the contents.
692692 args : Vec < Operand < ' tcx > > ,
693693 /// Destination for the return value. If some, the call is converging.
694- destination : Option < ( Lvalue < ' tcx > , BasicBlock ) > ,
694+ destination : Option < ( Place < ' tcx > , BasicBlock ) > ,
695695 /// Cleanups to be done if the call unwinds.
696696 cleanup : Option < BasicBlock >
697697 } ,
@@ -1002,11 +1002,11 @@ impl<'tcx> Statement<'tcx> {
10021002
10031003#[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
10041004pub enum StatementKind < ' tcx > {
1005- /// Write the RHS Rvalue to the LHS Lvalue .
1006- Assign ( Lvalue < ' tcx > , Rvalue < ' tcx > ) ,
1005+ /// Write the RHS Rvalue to the LHS Place .
1006+ Assign ( Place < ' tcx > , Rvalue < ' tcx > ) ,
10071007
1008- /// Write the discriminant for a variant to the enum Lvalue .
1009- SetDiscriminant { lvalue : Lvalue < ' tcx > , variant_index : usize } ,
1008+ /// Write the discriminant for a variant to the enum Place .
1009+ SetDiscriminant { lvalue : Place < ' tcx > , variant_index : usize } ,
10101010
10111011 /// Start a live range for the storage of the local.
10121012 StorageLive ( Local ) ,
@@ -1017,14 +1017,14 @@ pub enum StatementKind<'tcx> {
10171017 /// Execute a piece of inline Assembly.
10181018 InlineAsm {
10191019 asm : Box < InlineAsm > ,
1020- outputs : Vec < Lvalue < ' tcx > > ,
1020+ outputs : Vec < Place < ' tcx > > ,
10211021 inputs : Vec < Operand < ' tcx > >
10221022 } ,
10231023
10241024 /// Assert the given lvalues to be valid inhabitants of their type. These statements are
10251025 /// currently only interpreted by miri and only generated when "-Z mir-emit-validate" is passed.
10261026 /// See <https://internals.rust-lang.org/t/types-as-contracts/5562/73> for more details.
1027- Validate ( ValidationOp , Vec < ValidationOperand < ' tcx , Lvalue < ' tcx > > > ) ,
1027+ Validate ( ValidationOp , Vec < ValidationOperand < ' tcx , Place < ' tcx > > > ) ,
10281028
10291029 /// Mark one terminating point of a region scope (i.e. static region).
10301030 /// (The starting point(s) arise implicitly from borrows.)
@@ -1107,20 +1107,20 @@ impl<'tcx> Debug for Statement<'tcx> {
11071107}
11081108
11091109///////////////////////////////////////////////////////////////////////////
1110- // Lvalues
1110+ // Places
11111111
11121112/// A path to a value; something that can be evaluated without
11131113/// changing or disturbing program state.
11141114#[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable ) ]
1115- pub enum Lvalue < ' tcx > {
1115+ pub enum Place < ' tcx > {
11161116 /// local variable
11171117 Local ( Local ) ,
11181118
11191119 /// static or static mut variable
11201120 Static ( Box < Static < ' tcx > > ) ,
11211121
11221122 /// projection out of an lvalue (access a field, deref a pointer, etc)
1123- Projection ( Box < LvalueProjection < ' tcx > > ) ,
1123+ Projection ( Box < PlaceProjection < ' tcx > > ) ,
11241124}
11251125
11261126/// The def-id of a static, along with its normalized type (which is
@@ -1138,8 +1138,8 @@ impl_stable_hash_for!(struct Static<'tcx> {
11381138
11391139/// The `Projection` data structure defines things of the form `B.x`
11401140/// or `*B` or `B[index]`. Note that it is parameterized because it is
1141- /// shared between `Constant` and `Lvalue `. See the aliases
1142- /// `LvalueProjection ` etc below.
1141+ /// shared between `Constant` and `Place `. See the aliases
1142+ /// `PlaceProjection ` etc below.
11431143#[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
11441144pub struct Projection < ' tcx , B , V , T > {
11451145 pub base : B ,
@@ -1186,42 +1186,42 @@ pub enum ProjectionElem<'tcx, V, T> {
11861186
11871187/// Alias for projections as they appear in lvalues, where the base is an lvalue
11881188/// and the index is a local.
1189- pub type LvalueProjection < ' tcx > = Projection < ' tcx , Lvalue < ' tcx > , Local , Ty < ' tcx > > ;
1189+ pub type PlaceProjection < ' tcx > = Projection < ' tcx , Place < ' tcx > , Local , Ty < ' tcx > > ;
11901190
11911191/// Alias for projections as they appear in lvalues, where the base is an lvalue
11921192/// and the index is a local.
1193- pub type LvalueElem < ' tcx > = ProjectionElem < ' tcx , Local , Ty < ' tcx > > ;
1193+ pub type PlaceElem < ' tcx > = ProjectionElem < ' tcx , Local , Ty < ' tcx > > ;
11941194
11951195newtype_index ! ( Field { DEBUG_FORMAT = "field[{}]" } ) ;
11961196
1197- impl < ' tcx > Lvalue < ' tcx > {
1198- pub fn field ( self , f : Field , ty : Ty < ' tcx > ) -> Lvalue < ' tcx > {
1197+ impl < ' tcx > Place < ' tcx > {
1198+ pub fn field ( self , f : Field , ty : Ty < ' tcx > ) -> Place < ' tcx > {
11991199 self . elem ( ProjectionElem :: Field ( f, ty) )
12001200 }
12011201
1202- pub fn deref ( self ) -> Lvalue < ' tcx > {
1202+ pub fn deref ( self ) -> Place < ' tcx > {
12031203 self . elem ( ProjectionElem :: Deref )
12041204 }
12051205
1206- pub fn downcast ( self , adt_def : & ' tcx AdtDef , variant_index : usize ) -> Lvalue < ' tcx > {
1206+ pub fn downcast ( self , adt_def : & ' tcx AdtDef , variant_index : usize ) -> Place < ' tcx > {
12071207 self . elem ( ProjectionElem :: Downcast ( adt_def, variant_index) )
12081208 }
12091209
1210- pub fn index ( self , index : Local ) -> Lvalue < ' tcx > {
1210+ pub fn index ( self , index : Local ) -> Place < ' tcx > {
12111211 self . elem ( ProjectionElem :: Index ( index) )
12121212 }
12131213
1214- pub fn elem ( self , elem : LvalueElem < ' tcx > ) -> Lvalue < ' tcx > {
1215- Lvalue :: Projection ( Box :: new ( LvalueProjection {
1214+ pub fn elem ( self , elem : PlaceElem < ' tcx > ) -> Place < ' tcx > {
1215+ Place :: Projection ( Box :: new ( PlaceProjection {
12161216 base : self ,
12171217 elem,
12181218 } ) )
12191219 }
12201220}
12211221
1222- impl < ' tcx > Debug for Lvalue < ' tcx > {
1222+ impl < ' tcx > Debug for Place < ' tcx > {
12231223 fn fmt ( & self , fmt : & mut Formatter ) -> fmt:: Result {
1224- use self :: Lvalue :: * ;
1224+ use self :: Place :: * ;
12251225
12261226 match * self {
12271227 Local ( id) => write ! ( fmt, "{:?}" , id) ,
@@ -1281,13 +1281,13 @@ pub enum Operand<'tcx> {
12811281 ///
12821282 /// This implies that the type of the lvalue must be `Copy`; this is true
12831283 /// by construction during build, but also checked by the MIR type checker.
1284- Copy ( Lvalue < ' tcx > ) ,
1284+ Copy ( Place < ' tcx > ) ,
12851285 /// Move: The value (including old borrows of it) will not be used again.
12861286 ///
12871287 /// Safe for values of all types (modulo future developments towards `?Move`).
12881288 /// Correct usage patterns are enforced by the borrow checker for safe code.
12891289 /// `Copy` may be converted to `Move` to enable "last-use" optimizations.
1290- Move ( Lvalue < ' tcx > ) ,
1290+ Move ( Place < ' tcx > ) ,
12911291 Constant ( Box < Constant < ' tcx > > ) ,
12921292}
12931293
@@ -1336,10 +1336,10 @@ pub enum Rvalue<'tcx> {
13361336 Repeat ( Operand < ' tcx > , ConstUsize ) ,
13371337
13381338 /// &x or &mut x
1339- Ref ( Region < ' tcx > , BorrowKind , Lvalue < ' tcx > ) ,
1339+ Ref ( Region < ' tcx > , BorrowKind , Place < ' tcx > ) ,
13401340
13411341 /// length of a [X] or [X;n] value
1342- Len ( Lvalue < ' tcx > ) ,
1342+ Len ( Place < ' tcx > ) ,
13431343
13441344 Cast ( CastKind , Operand < ' tcx > , Ty < ' tcx > ) ,
13451345
@@ -1353,7 +1353,7 @@ pub enum Rvalue<'tcx> {
13531353 ///
13541354 /// Undefined (i.e. no effort is made to make it defined, but there’s no reason why it cannot
13551355 /// be defined to return, say, a 0) if ADT is not an enum.
1356- Discriminant ( Lvalue < ' tcx > ) ,
1356+ Discriminant ( Place < ' tcx > ) ,
13571357
13581358 /// Create an aggregate value, like a tuple or struct. This is
13591359 /// only needed because we want to distinguish `dest = Foo { x:
@@ -1828,7 +1828,7 @@ impl<'tcx> TypeFoldable<'tcx> for BasicBlockData<'tcx> {
18281828 }
18291829}
18301830
1831- impl < ' tcx > TypeFoldable < ' tcx > for ValidationOperand < ' tcx , Lvalue < ' tcx > > {
1831+ impl < ' tcx > TypeFoldable < ' tcx > for ValidationOperand < ' tcx , Place < ' tcx > > {
18321832 fn super_fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > > ( & self , folder : & mut F ) -> Self {
18331833 ValidationOperand {
18341834 lval : self . lval . fold_with ( folder) ,
@@ -2012,16 +2012,16 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
20122012 }
20132013}
20142014
2015- impl < ' tcx > TypeFoldable < ' tcx > for Lvalue < ' tcx > {
2015+ impl < ' tcx > TypeFoldable < ' tcx > for Place < ' tcx > {
20162016 fn super_fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > > ( & self , folder : & mut F ) -> Self {
20172017 match self {
2018- & Lvalue :: Projection ( ref p) => Lvalue :: Projection ( p. fold_with ( folder) ) ,
2018+ & Place :: Projection ( ref p) => Place :: Projection ( p. fold_with ( folder) ) ,
20192019 _ => self . clone ( )
20202020 }
20212021 }
20222022
20232023 fn super_visit_with < V : TypeVisitor < ' tcx > > ( & self , visitor : & mut V ) -> bool {
2024- if let & Lvalue :: Projection ( ref p) = self {
2024+ if let & Place :: Projection ( ref p) = self {
20252025 p. visit_with ( visitor)
20262026 } else {
20272027 false
0 commit comments