Skip to content

Commit cbaaf05

Browse files
Fix Analysis example
1 parent d583fef commit cbaaf05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_mir/dataflow/generic.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ use crate::dataflow::BottomValue;
2323
///
2424
/// ```ignore(cross-crate-imports)
2525
/// fn do_my_analysis(body: &mir::Body<'tcx>, dead_unwinds: &BitSet<BasicBlock>) {
26+
/// // `MyAnalysis` implements `Analysis`.
2627
/// let analysis = MyAnalysis::new();
28+
///
2729
/// let results = Engine::new(body, dead_unwinds, analysis).iterate_to_fixpoint();
28-
/// let mut cursor = dataflow::ResultsCursor::new(body, results);
30+
/// let mut cursor = ResultsCursor::new(body, results);
2931
///
30-
/// for statement_index in body.block_data[START_BLOCK].statements.iter() {
32+
/// for (_, statement_index) in body.block_data[START_BLOCK].statements.iter_enumerated() {
3133
/// cursor.seek_after(Location { block: START_BLOCK, statement_index });
3234
/// let state = cursor.get();
3335
/// println!("{:?}", state);

0 commit comments

Comments
 (0)