@@ -216,31 +216,31 @@ The MIR data types are defined in the [`compiler/rustc_middle/src/mir/`][mir]
216
216
module. Each of the key concepts mentioned in the previous section
217
217
maps in a fairly straightforward way to a Rust type.
218
218
219
- The main MIR data type is `Mir` . It contains the data for a single
219
+ The main MIR data type is [`Body`] . It contains the data for a single
220
220
function (along with sub-instances of Mir for "promoted constants",
221
221
but [you can read about those below](#promoted)).
222
222
223
223
- **Basic blocks**: The basic blocks are stored in the field
224
- [`Body::basic_blocks`][basicblocks]; this is a vector
224
+ [`Body::basic_blocks`][basicblocks]; this is a vector
225
225
of [`BasicBlockData`] structures. Nobody ever references a
226
226
basic block directly : instead, we pass around [`BasicBlock`]
227
227
values, which are [newtype'd] indices into this vector.
228
228
- **Statements** are represented by the type [`Statement`].
229
- - **Terminators** are represented by the `Terminator`.
229
+ - **Terminators** are represented by the [ `Terminator`] .
230
230
- **Locals** are represented by a [newtype'd] index type [`Local`].
231
- The data for a local variable is found in the `Mir` (the `local_decls`
232
- vector). There is also a special constant `RETURN_PLACE` identifying
233
- the special "local" representing the return value.
234
- - **Places** are identified by the enum [`Place`]. There are a few
231
+ The data for a local variable is found in the
232
+ [`Body::local_decls`][localdecls] vector). There is also a special constant
233
+ [`RETURN_PLACE`] identifying the special "local" representing the return value.
234
+ - **Places** are identified by the enum [`Place`]. There are a few
235
235
variants :
236
236
- Local variables like `_1`
237
237
- Static variables `FOO`
238
238
- **Projections**, which are fields or other things that "project
239
- out" from a base place. These are represented by the type
240
- [`Projection `]. So e.g. the place `_1.f` is a projection,
241
- with `f` being the "projection element and `_1` being the base
239
+ out" from a base place. These are represented by the type
240
+ [`ProjectionElem `]. So e.g. the place `_1.f` is a projection,
241
+ with `f` being the "projection element" and `_1` being the base
242
242
path. `*_1` is also a projection, with the `*` being represented
243
- by the `ProjectionElem::Deref` element.
243
+ by the [ `ProjectionElem::Deref`] element.
244
244
- **Rvalues** are represented by the enum [`Rvalue`].
245
245
- **Operands** are represented by the enum [`Operand`].
246
246
@@ -257,13 +257,18 @@ but [you can read about those below](#promoted)).
257
257
258
258
[mir] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/index.html
259
259
[mirmanip] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/index.html
260
+ [`Body`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html
260
261
[newtype'd] : ../appendix/glossary.html#newtype
261
- [basicblocks]( https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.basic_blocks)
262
+ [basicblocks] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.basic_blocks
262
263
[`BasicBlock`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.BasicBlock.html
263
264
[`BasicBlockData`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.BasicBlockData.html
264
265
[`Statement`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Statement.html
265
266
[`Terminator`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/terminator/struct.Terminator.html
266
267
[`Local`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Local.html
268
+ [localdecls] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.local_decls
269
+ [`RETURN_PLACE`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/constant.RETURN_PLACE.html
267
270
[`Place`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Place.html
271
+ [`ProjectionElem`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.ProjectionElem.html
272
+ [`ProjectionElem::Deref`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.ProjectionElem.html#variant.Deref
268
273
[`Rvalue`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.Rvalue.html
269
274
[`Operand`] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.Operand.html
0 commit comments