Skip to content

Commit 327ce2e

Browse files
committed
Make librustc_mir pass rustdoc
1 parent a43eb4e commit 327ce2e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustc_mir/traversal.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ use rustc::mir::repr::*;
1919
/// Preorder traversal is when each node is visited before an of it's
2020
/// successors
2121
///
22+
/// ```text
23+
///
2224
/// A
2325
/// / \
2426
/// / \
2527
/// B C
2628
/// \ /
2729
/// \ /
2830
/// D
31+
/// ```
2932
///
3033
/// A preorder traversal of this graph is either `A B D C` or `A C D B`
3134
#[derive(Clone)]
@@ -80,13 +83,17 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> {
8083
/// Postorder traversal is when each node is visited after all of it's
8184
/// successors, except when the successor is only reachable by a back-edge
8285
///
86+
///
87+
/// ```text
88+
///
8389
/// A
8490
/// / \
8591
/// / \
8692
/// B C
8793
/// \ /
8894
/// \ /
8995
/// D
96+
/// ```
9097
///
9198
/// A Postorder traversal of this graph is `D B C A` or `D C B A`
9299
pub struct Postorder<'a, 'tcx: 'a> {
@@ -215,13 +222,16 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
215222
/// This is different to a preorder traversal and represents a natural
216223
/// linearisation of control-flow.
217224
///
225+
/// ```text
226+
///
218227
/// A
219228
/// / \
220229
/// / \
221230
/// B C
222231
/// \ /
223232
/// \ /
224233
/// D
234+
/// ```
225235
///
226236
/// A reverse postorder traversal of this graph is either `A B C D` or `A C B D`
227237
/// Note that for a graph containing no loops (i.e. A DAG), this is equivalent to

0 commit comments

Comments
 (0)