You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/src/glossary.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -133,19 +133,20 @@ niche.
133
133
134
134
A *place* (called "lvalue" in C and "glvalue" in C++) is the result of computing a [*place expression*][place-value-expr].
135
135
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).
136
-
A place has a type.
137
-
Places cannot be "stored" in memory, only [values](#value) can.
136
+
A place has a type, indicating the type of [values](#value) that it stores.
137
+
Places cannot be "stored" in memory, only values can.
138
138
139
139
The key operations on a place are:
140
140
* storing a [value](#value) of the same type in it (when it is used on the left-hand side of an assignment),
141
-
* turning it into a [pointer value](#value) (when it is used inside `&expr`),
141
+
* turning it into a [pointer value](#value) (when it is used inside `&expr`), which is also the only way to "store" a place,
142
142
* and loading a [value](#value) of the same type from it (through the place-to-value coercion).
143
143
144
144
145
145
#### Value
146
146
147
147
A *value* (called "value of the expression" or "rvalue" in C and "prvalue" in C++) is what gets stored in a [place](#place), and also the result of computing a [*value expression*][place-value-expr].
148
148
A value has a type, and it denotes the abstract mathematical concept that is represented by data in our programs.
149
+
149
150
For example, a value of type `u8` is a mathematical integer in the range `0..256`.
150
151
Values can be (according to their type) turned into a list of bytes, which is called a [representation](#representation) of the value.
151
152
Values are ephemeral; they arise during the computation of an instruction but are only ever persisted in memory through their representation.
0 commit comments