diff options
| author | Camelid <camelidcamel@gmail.com> | 2020-10-16 20:35:56 -0700 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2020-10-17 13:20:42 -0700 |
| commit | 91ba04d872ad13b93e80c8bda42d06b62d5deaa2 (patch) | |
| tree | 91b4335f0493b201227895ca8e9f042ca167a3e0 | |
| parent | f1b97ee7f8ffb1a814944b85c7e05a1555a7eda5 (diff) | |
Note that `BasicBlock` is just an index
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 16472c78757..b38efedbf60 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -146,7 +146,7 @@ impl<'tcx> MirSource<'tcx> { /// The lowered representation of a single function. #[derive(Clone, TyEncodable, TyDecodable, Debug, HashStable, TypeFoldable)] pub struct Body<'tcx> { - /// A list of basic blocks. References to basic block use a newtyped index type `BasicBlock` + /// A list of basic blocks. References to basic block use a newtyped index type [`BasicBlock`] /// that indexes into this vector. basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>, @@ -1106,6 +1106,9 @@ rustc_index::newtype_index! { /// are edges that go from a multi-successor node to a multi-predecessor node. This pass is /// needed because some analyses require that there are no critical edges in the CFG. /// + /// Note that this type is just an index into [`Body.basic_blocks`](Body::basic_blocks); + /// the actual data that a basic block holds is in [`BasicBlockData`]. + /// /// Read more about basic blocks in the [rustc-dev-guide][guide-mir]. /// /// [CFG]: https://rustc-dev-guide.rust-lang.org/appendix/background.html#cfg |
