From 933a9941114a9ac5ce92cc7197498f698a86c3f4 Mon Sep 17 00:00:00 2001 From: pierwill Date: Thu, 7 Jul 2022 11:32:52 -0500 Subject: [PATCH] Add doc comments in `rustc_middle::mir` --- compiler/rustc_middle/src/mir/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index e7d7317456c74..156aad1ec39ad 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1156,6 +1156,8 @@ impl BasicBlock { /////////////////////////////////////////////////////////////////////////// // BasicBlockData +/// Data for a basic block, including a list of its statements. +/// /// See [`BasicBlock`] for documentation on what basic blocks are at a high level. #[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)] pub struct BasicBlockData<'tcx> { @@ -1187,7 +1189,7 @@ impl<'tcx> BasicBlockData<'tcx> { /// Accessor for terminator. /// /// Terminator may not be None after construction of the basic block is complete. This accessor - /// provides a convenience way to reach the terminator. + /// provides a convenient way to reach the terminator. #[inline] pub fn terminator(&self) -> &Terminator<'tcx> { self.terminator.as_ref().expect("invalid terminator state") @@ -1394,6 +1396,7 @@ impl fmt::Debug for AssertKind { /////////////////////////////////////////////////////////////////////////// // Statements +/// A statement in a basic block, including information about its source code. #[derive(Clone, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)] pub struct Statement<'tcx> { pub source_info: SourceInfo,