Address documentation suggestions
This commit is contained in:
parent
aca1bc5f37
commit
b580f29b74
@ -25,10 +25,10 @@
|
|||||||
//!
|
//!
|
||||||
//! {
|
//! {
|
||||||
//! let temp1 = x;
|
//! let temp1 = x;
|
||||||
//! Goto(exit)
|
//! Goto(my_second_block)
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! exit = {
|
//! my_second_block = {
|
||||||
//! temp2 = Move(temp1);
|
//! temp2 = Move(temp1);
|
||||||
//! RET = temp2;
|
//! RET = temp2;
|
||||||
//! Return()
|
//! Return()
|
||||||
@ -37,12 +37,14 @@
|
|||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! Hopefully the syntax is fairly self-explanatory to anyone familiar with MIR. The `custom_mir`
|
//! The `custom_mir` attribute tells the compiler to treat the function as being custom MIR. This
|
||||||
//! attribute tells the compiler to treat the function as being custom MIR. This attribute only
|
//! attribute only works on functions - there is no way to insert custom MIR into the middle of
|
||||||
//! works on functions - there is no way to insert custom MIR into the middle of another function.
|
//! another function. The `dialect` and `phase` parameters indicate which [version of MIR][dialect
|
||||||
//! The `dialect` and `phase` parameters indicate which version of MIR you are inserting here. This
|
//! docs] you are inserting here. Generally you'll want to use `#![custom_mir(dialect = "built")]`
|
||||||
//! will normally be the phase that corresponds to the thing you are trying to test. The phase can
|
//! if you want your MIR to be modified by the full MIR pipeline, or `#![custom_mir(dialect =
|
||||||
//! be omitted for dialects that have just one.
|
//! "runtime", phase = "optimized")] if you don't.
|
||||||
|
//!
|
||||||
|
//! [dialect docs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.MirPhase.html
|
||||||
//!
|
//!
|
||||||
//! The input to the [`mir!`] macro is:
|
//! The input to the [`mir!`] macro is:
|
||||||
//!
|
//!
|
||||||
@ -159,7 +161,7 @@
|
|||||||
//!
|
//!
|
||||||
//! # Syntax
|
//! # Syntax
|
||||||
//!
|
//!
|
||||||
//! The lists below are an exahustive description of how various MIR constructs can be created.
|
//! The lists below are an exhaustive description of how various MIR constructs can be created.
|
||||||
//! Anything missing from the list should be assumed to not be supported, PRs welcome.
|
//! Anything missing from the list should be assumed to not be supported, PRs welcome.
|
||||||
//!
|
//!
|
||||||
//! #### Locals
|
//! #### Locals
|
||||||
@ -171,8 +173,8 @@
|
|||||||
//! #### Places
|
//! #### Places
|
||||||
//! - Locals implicit convert to places.
|
//! - Locals implicit convert to places.
|
||||||
//! - Field accesses, derefs, and indexing work normally.
|
//! - Field accesses, derefs, and indexing work normally.
|
||||||
//! - Fields in variants can be accessed via the [`Variant`] and [`Field`] methods, see their
|
//! - Fields in variants can be accessed via the [`Variant`] and [`Field`] associated functions,
|
||||||
//! documentation for details.
|
//! see their documentation for details.
|
||||||
//!
|
//!
|
||||||
//! #### Operands
|
//! #### Operands
|
||||||
//! - Places implicitly convert to `Copy` operands.
|
//! - Places implicitly convert to `Copy` operands.
|
||||||
|
Loading…
Reference in New Issue
Block a user