diff --git a/src/librustc_mir/dataflow/graphviz.rs b/src/librustc_mir/dataflow/graphviz.rs index f8dc7d2a2a8d1..7475b4d82f452 100644 --- a/src/librustc_mir/dataflow/graphviz.rs +++ b/src/librustc_mir/dataflow/graphviz.rs @@ -73,8 +73,8 @@ pub type Node = BasicBlock; pub struct Edge { source: BasicBlock, index: usize } fn outgoing(mir: &Mir, bb: BasicBlock) -> Vec { - mir[bb].terminator().successors().enumerate() - .map(|(index, _)| Edge { source: bb, index: index}).collect() + (0..mir[bb].terminator().successors().count()) + .map(|index| Edge { source: bb, index: index}).collect() } impl<'a, 'tcx, MWF, P> dot::Labeller<'a> for Graph<'a, 'tcx, MWF, P> diff --git a/src/librustc_mir/dataflow/mod.rs b/src/librustc_mir/dataflow/mod.rs index f58609aa9a516..4227f0bcd362d 100644 --- a/src/librustc_mir/dataflow/mod.rs +++ b/src/librustc_mir/dataflow/mod.rs @@ -441,11 +441,6 @@ pub struct DataflowState } impl DataflowState { - pub fn each_bit(&self, words: &IdxSet, f: F) where F: FnMut(O::Idx) - { - words.iter().for_each(f) - } - pub(crate) fn interpret_set<'c, P>(&self, o: &'c O, words: &IdxSet, @@ -453,11 +448,7 @@ impl DataflowState { -> Vec where P: Fn(&O, O::Idx) -> DebugFormatted { - let mut v = Vec::new(); - self.each_bit(words, |i| { - v.push(render_idx(o, i)); - }); - v + words.iter().map(|i| render_idx(o, i)).collect() } }