From 004c2b90ef5fcf59a78e8a6a241a9824ecd06624 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sun, 15 Sep 2024 11:48:20 +1000 Subject: [PATCH] coverage: Remove unnecessary `bcb_successors` Given that we directly access the graph predecessors/successors in so many other places, and sometimes must do so to satisfy the borrow checker, there is little value in having this trivial helper method. --- compiler/rustc_mir_transform/src/coverage/counters.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/rustc_mir_transform/src/coverage/counters.rs b/compiler/rustc_mir_transform/src/coverage/counters.rs index eaece3fdfb9f..02e697f7fc51 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters.rs @@ -323,8 +323,7 @@ impl<'a> MakeBcbCounters<'a> { } // Determine the set of out-edges that don't yet have edge counters. - let candidate_successors = self - .bcb_successors(from_bcb) + let candidate_successors = self.basic_coverage_blocks.successors[from_bcb] .iter() .copied() .filter(|&to_bcb| self.edge_has_no_counter(from_bcb, to_bcb)) @@ -502,11 +501,6 @@ impl<'a> MakeBcbCounters<'a> { None } - #[inline] - fn bcb_successors(&self, bcb: BasicCoverageBlock) -> &[BasicCoverageBlock] { - &self.basic_coverage_blocks.successors[bcb] - } - #[inline] fn edge_has_no_counter( &self,