Skip to content

Commit b580f29

Browse files
committed
Address documentation suggestions
1 parent aca1bc5 commit b580f29

File tree

1 file changed

+13
-11
lines changed
  • library/core/src/intrinsics

1 file changed

+13
-11
lines changed

library/core/src/intrinsics/mir.rs

+13-11
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
//!
2626
//! {
2727
//! let temp1 = x;
28-
//! Goto(exit)
28+
//! Goto(my_second_block)
2929
//! }
3030
//!
31-
//! exit = {
31+
//! my_second_block = {
3232
//! temp2 = Move(temp1);
3333
//! RET = temp2;
3434
//! Return()
@@ -37,12 +37,14 @@
3737
//! }
3838
//! ```
3939
//!
40-
//! Hopefully the syntax is fairly self-explanatory to anyone familiar with MIR. The `custom_mir`
41-
//! attribute tells the compiler to treat the function as being custom MIR. This attribute only
42-
//! works on functions - there is no way to insert custom MIR into the middle of another function.
43-
//! The `dialect` and `phase` parameters indicate which version of MIR you are inserting here. This
44-
//! will normally be the phase that corresponds to the thing you are trying to test. The phase can
45-
//! be omitted for dialects that have just one.
40+
//! The `custom_mir` attribute tells the compiler to treat the function as being custom MIR. This
41+
//! attribute only works on functions - there is no way to insert custom MIR into the middle of
42+
//! another function. The `dialect` and `phase` parameters indicate which [version of MIR][dialect
43+
//! docs] you are inserting here. Generally you'll want to use `#![custom_mir(dialect = "built")]`
44+
//! if you want your MIR to be modified by the full MIR pipeline, or `#![custom_mir(dialect =
45+
//! "runtime", phase = "optimized")] if you don't.
46+
//!
47+
//! [dialect docs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.MirPhase.html
4648
//!
4749
//! The input to the [`mir!`] macro is:
4850
//!
@@ -159,7 +161,7 @@
159161
//!
160162
//! # Syntax
161163
//!
162-
//! The lists below are an exahustive description of how various MIR constructs can be created.
164+
//! The lists below are an exhaustive description of how various MIR constructs can be created.
163165
//! Anything missing from the list should be assumed to not be supported, PRs welcome.
164166
//!
165167
//! #### Locals
@@ -171,8 +173,8 @@
171173
//! #### Places
172174
//! - Locals implicit convert to places.
173175
//! - Field accesses, derefs, and indexing work normally.
174-
//! - Fields in variants can be accessed via the [`Variant`] and [`Field`] methods, see their
175-
//! documentation for details.
176+
//! - Fields in variants can be accessed via the [`Variant`] and [`Field`] associated functions,
177+
//! see their documentation for details.
176178
//!
177179
//! #### Operands
178180
//! - Places implicitly convert to `Copy` operands.

0 commit comments

Comments
 (0)