Skip to content

Commit

Permalink
place ops
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 28, 2019
1 parent 9c8bf98 commit f0511a2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions reference/src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,12 @@ requirement of 2.
A *place* (called "lvalue" in C and "glvalue" in C++) is the result of computing a [*place expression*][place-value-expr].
A place is basically a pointer (pointing to some location in memory, potentially carrying [provenance](#pointer-provenance)), but might contain more information such as size or alignment (the details will have to be determined as the Rust Abstract Machine gets specified more precisely).
A place has a type, indicating the type of [values](#value) that it stores.
Places cannot be "stored" in memory, only values can.

The key operations on a place are:
* storing a [value](#value) of the same type in it (when it is used on the left-hand side of an assignment),
* turning it into a [pointer value](#value) (when it is used inside `&expr`), which is also the only way to "store" a place,
* and loading a [value](#value) of the same type from it (through the place-to-value coercion).

* Storing a [value](#value) of the same type in it (when it is used on the left-hand side of an assignment).
* Loading a [value](#value) of the same type from it (through the place-to-value coercion).
* Converting between a place (of type `T`) and a pointer value (of type `&T`, `&mut T`, `*const T` or `*mut T`) using the `&` and `*` operators.
This is also the only way a place can be "stored": by converting it to a value first.

#### Value

Expand Down

0 comments on commit f0511a2

Please sign in to comment.