Skip to content

Commit a872ec4

Browse files
committed
Clarify how branching works in a CFG
1 parent fd79ed4 commit a872ec4

File tree

1 file changed

+5
-3
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+5
-3
lines changed

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,9 +1079,11 @@ rustc_index::newtype_index! {
10791079
/// The unit of the MIR [control-flow graph][CFG].
10801080
///
10811081
/// There is no branching (e.g., `if`s, function calls, etc.) within a basic block, which makes
1082-
/// it easier to do [data-flow analyses] and optimizations. Basic blocks consist of a series of
1083-
/// [statements][`Statement`], ending with a [terminator][`Terminator`]. Basic blocks can have
1084-
/// multiple predecessors and successors.
1082+
/// it easier to do [data-flow analyses] and optimizations. Instead, branches are represented
1083+
/// as an edge in a graph between basic blocks.
1084+
///
1085+
/// Basic blocks consist of a series of [statements][`Statement`], ending with a
1086+
/// [terminator][`Terminator`]. Basic blocks can have multiple predecessors and successors.
10851087
///
10861088
/// Read more about basic blocks in the [rustc-dev-guide][guide-mir].
10871089
///

0 commit comments

Comments
 (0)