Skip to content

Commit ad268bd

Browse files
committed
Auto merge of #78035 - camelid:basic-block-pointer-note, r=RalfJung
Note that `BasicBlock` is just an index r? `@RalfJung`
2 parents 94332bb + 91ba04d commit ad268bd

File tree

1 file changed

+4
-1
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+4
-1
lines changed

compiler/rustc_middle/src/mir/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<'tcx> MirSource<'tcx> {
146146
/// The lowered representation of a single function.
147147
#[derive(Clone, TyEncodable, TyDecodable, Debug, HashStable, TypeFoldable)]
148148
pub struct Body<'tcx> {
149-
/// A list of basic blocks. References to basic block use a newtyped index type `BasicBlock`
149+
/// A list of basic blocks. References to basic block use a newtyped index type [`BasicBlock`]
150150
/// that indexes into this vector.
151151
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
152152

@@ -1106,6 +1106,9 @@ rustc_index::newtype_index! {
11061106
/// are edges that go from a multi-successor node to a multi-predecessor node. This pass is
11071107
/// needed because some analyses require that there are no critical edges in the CFG.
11081108
///
1109+
/// Note that this type is just an index into [`Body.basic_blocks`](Body::basic_blocks);
1110+
/// the actual data that a basic block holds is in [`BasicBlockData`].
1111+
///
11091112
/// Read more about basic blocks in the [rustc-dev-guide][guide-mir].
11101113
///
11111114
/// [CFG]: https://rustc-dev-guide.rust-lang.org/appendix/background.html#cfg

0 commit comments

Comments
 (0)