Auto merge of #78035 - camelid:basic-block-pointer-note, r=RalfJung

Note that `BasicBlock` is just an index

r? `@RalfJung`
This commit is contained in:
bors 2020-10-18 09:08:00 +00:00
commit ad268bd638

View File

@ -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