about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakob Degen <jakob.e.degen@gmail.com>2022-12-10 22:07:11 -0800
committerJakob Degen <jakob.e.degen@gmail.com>2022-12-14 01:10:43 -0800
commitb580f29b744d845f75d959d63943ffeab55671fd (patch)
treed52b91d8f09bf6cffa2211d328fe7b08f7de05ff
parentaca1bc5f377fe64a01c1793906c22bb9f749038a (diff)
downloadrust-b580f29b744d845f75d959d63943ffeab55671fd.tar.gz
rust-b580f29b744d845f75d959d63943ffeab55671fd.zip
Address documentation suggestions
-rw-r--r--library/core/src/intrinsics/mir.rs24
1 files changed, 13 insertions, 11 deletions
diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs
index e7fa9af9d50..0910ce599b7 100644
--- a/library/core/src/intrinsics/mir.rs
+++ b/library/core/src/intrinsics/mir.rs
@@ -25,10 +25,10 @@
 //!
 //!         {
 //!             let temp1 = x;
-//!             Goto(exit)
+//!             Goto(my_second_block)
 //!         }
 //!
-//!         exit = {
+//!         my_second_block = {
 //!             temp2 = Move(temp1);
 //!             RET = temp2;
 //!             Return()
@@ -37,12 +37,14 @@
 //! }
 //! ```
 //!
-//! Hopefully the syntax is fairly self-explanatory to anyone familiar with MIR. The `custom_mir`
-//! attribute tells the compiler to treat the function as being custom MIR. This attribute only
-//! works on functions - there is no way to insert custom MIR into the middle of another function.
-//! The `dialect` and `phase` parameters indicate which version of MIR you are inserting here. This
-//! will normally be the phase that corresponds to the thing you are trying to test. The phase can
-//! be omitted for dialects that have just one.
+//! The `custom_mir` attribute tells the compiler to treat the function as being custom MIR. This
+//! attribute only works on functions - there is no way to insert custom MIR into the middle of
+//! another function. The `dialect` and `phase` parameters indicate which [version of MIR][dialect
+//! docs] you are inserting here. Generally you'll want to use `#![custom_mir(dialect = "built")]`
+//! if you want your MIR to be modified by the full MIR pipeline, or `#![custom_mir(dialect =
+//! "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:
 //!
@@ -159,7 +161,7 @@
 //!
 //! # 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.
 //!
 //! #### Locals
@@ -171,8 +173,8 @@
 //! #### Places
 //!  - Locals implicit convert to places.
 //!  - Field accesses, derefs, and indexing work normally.
-//!  - Fields in variants can be accessed via the [`Variant`] and [`Field`] methods, see their
-//!    documentation for details.
+//!  - Fields in variants can be accessed via the [`Variant`] and [`Field`] associated functions,
+//!    see their documentation for details.
 //!
 //! #### Operands
 //!  - Places implicitly convert to `Copy` operands.