diff --git a/rr_frontend/.cargo/config.toml b/rr_frontend/.cargo/config.toml index b3a1f8517bf577cdcfaa1779c675b75c0f7696a8..f139a0f37387fbfa62da4a9c776ff3cb5d2b5b8c 100644 --- a/rr_frontend/.cargo/config.toml +++ b/rr_frontend/.cargo/config.toml @@ -80,7 +80,6 @@ rustflags = [ "-Aclippy::unwrap_in_result", # clippy::style - "-Aclippy::manual_while_let_some", "-Aclippy::map_clone", "-Aclippy::match_like_matches_macro", "-Aclippy::needless_borrow", diff --git a/rr_frontend/translation/src/checked_op_analysis.rs b/rr_frontend/translation/src/checked_op_analysis.rs index 9009d925f8318eac5f19be9aae3836bf7c6d6e8c..b7295099180085d8cc82f5c11ece016bc6dcb2cf 100644 --- a/rr_frontend/translation/src/checked_op_analysis.rs +++ b/rr_frontend/translation/src/checked_op_analysis.rs @@ -115,8 +115,7 @@ impl<'def, 'tcx> CheckedOpLocalAnalysis<'def, 'tcx> { self.bb_queue.push(BasicBlock::from_u32(0)); } - while !self.bb_queue.is_empty() { - let next_bb = self.bb_queue.pop().unwrap(); + while let Some(next_bb) = self.bb_queue.pop() { if !self.visited_bbs.contains(&next_bb) { self.visited_bbs.insert(next_bb); self.visit_bb(next_bb); diff --git a/rr_frontend/translation/src/environment/loops.rs b/rr_frontend/translation/src/environment/loops.rs index 7ed585e3e0a03d5e57730ce13e113466163beccf..75654faf62864518995ae0bc1f6e9164bbdffdaf 100644 --- a/rr_frontend/translation/src/environment/loops.rs +++ b/rr_frontend/translation/src/environment/loops.rs @@ -26,8 +26,8 @@ fn collect_loop_body( ) { let mut work_queue = vec![back_edge_source]; body.insert(back_edge_source); - while !work_queue.is_empty() { - let current = work_queue.pop().unwrap(); + + while let Some(current) = work_queue.pop() { for &predecessor in real_edges.predecessors(current) { if body.contains(&predecessor) { continue; @@ -38,6 +38,7 @@ fn collect_loop_body( } } } + debug!("Loop body (head={:?}): {:?}", head, body); } diff --git a/rr_frontend/translation/src/environment/procedure.rs b/rr_frontend/translation/src/environment/procedure.rs index 3180544cb123d9c0d6a46b365a5793e0bcd93d9d..3ab9916aaa7e69c35214849c44f3a6aab7e7c240 100644 --- a/rr_frontend/translation/src/environment/procedure.rs +++ b/rr_frontend/translation/src/environment/procedure.rs @@ -215,9 +215,7 @@ fn build_reachable_basic_blocks(mir: &Mir, real_edges: &RealEdges) -> HashSet<Ba let mut visited: HashSet<BasicBlock> = HashSet::new(); let mut to_visit: Vec<BasicBlock> = vec![mir.basic_blocks.indices().next().unwrap()]; - while !to_visit.is_empty() { - let source = to_visit.pop().unwrap(); - + while let Some(source) = to_visit.pop() { if visited.contains(&source) { continue; }