diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs index 5b95bb136e9..cb28a7285a7 100644 --- a/src/librustc_data_structures/obligation_forest/mod.rs +++ b/src/librustc_data_structures/obligation_forest/mod.rs @@ -285,7 +285,7 @@ pub fn register_obligation(&mut self, obligation: O) { let _ = self.register_obligation_at(obligation, None); } - // returns Err(()) if we already know this obligation failed. + // Returns Err(()) if we already know this obligation failed. fn register_obligation_at(&mut self, obligation: O, parent: Option) -> Result<(), ()> { @@ -425,7 +425,7 @@ pub fn process_obligations

(&mut self, processor: &mut P, do_completed: DoComp Some(NodeIndex::new(i)) ); if let Err(()) = st { - // error already reported - propagate it + // Error already reported - propagate it // to our node. self.error_at(i); } @@ -454,8 +454,6 @@ pub fn process_obligations

(&mut self, processor: &mut P, do_completed: DoComp self.mark_as_waiting(); self.process_cycles(processor); - - // Now we have to compress the result let completed = self.compress(do_completed); debug!("process_obligations: complete"); @@ -516,11 +514,11 @@ fn find_cycles_from_node

(&self, stack: &mut Vec, processor: &mut P, i: node.state.set(NodeState::Done); }, NodeState::Waiting | NodeState::Pending => { - // this node is still reachable from some pending node. We + // This node is still reachable from some pending node. We // will get to it when they are all processed. } NodeState::Done | NodeState::Error => { - // already processed that node + // Already processed that node. } }; } @@ -664,8 +662,7 @@ fn compress(&mut self, do_completed: DoCompleted) -> Option> { return if do_completed == DoCompleted::Yes { Some(vec![]) } else { None }; } - // Pop off all the nodes we killed and extract the success - // stories. + // Pop off all the nodes we killed and extract the success stories. let successful = if do_completed == DoCompleted::Yes { Some((0..dead_nodes) .map(|_| self.nodes.pop().unwrap()) @@ -696,7 +693,6 @@ fn apply_rewrites(&mut self, node_rewrites: &[usize]) { if let Some(index) = node.parent { let new_i = node_rewrites[index.index()]; if new_i >= nodes_len { - // parent dead due to error node.parent = None; } else { node.parent = Some(NodeIndex::new(new_i)); @@ -745,7 +741,7 @@ fn new( } } -// I need a Clone closure +// I need a Clone closure. #[derive(Clone)] struct GetObligation<'a, O>(&'a [Node]);