about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/counters.rs
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-11-21 20:07:32 +0100
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-11-21 20:13:40 +0100
commit21a870515b18e5b2b90435d0f1a6d3089b5217ae (patch)
tree4e2c8766f7f64f8a122f38338db2614f1f909a63 /compiler/rustc_mir_transform/src/coverage/counters.rs
parent0ff861096449f47956521b40e5e4e88caa7fe27c (diff)
downloadrust-21a870515b18e5b2b90435d0f1a6d3089b5217ae.tar.gz
rust-21a870515b18e5b2b90435d0f1a6d3089b5217ae.zip
Fix `clippy::needless_borrow` in the compiler
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.

Then I had to remove a few unnecessary parens and muts that were exposed
now.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/counters.rs')
-rw-r--r--compiler/rustc_mir_transform/src/coverage/counters.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/counters.rs b/compiler/rustc_mir_transform/src/coverage/counters.rs
index 1bc3c25c653..1e11d8d09b6 100644
--- a/compiler/rustc_mir_transform/src/coverage/counters.rs
+++ b/compiler/rustc_mir_transform/src/coverage/counters.rs
@@ -222,7 +222,7 @@ impl<'a> MakeBcbCounters<'a> {
         // all `BasicCoverageBlock` nodes in the loop are visited before visiting any node outside
         // the loop. The `traversal` state includes a `context_stack`, providing a way to know if
         // the current BCB is in one or more nested loops or not.
-        let mut traversal = TraverseCoverageGraphWithLoops::new(&self.basic_coverage_blocks);
+        let mut traversal = TraverseCoverageGraphWithLoops::new(self.basic_coverage_blocks);
         while let Some(bcb) = traversal.next() {
             if bcb_has_coverage_spans(bcb) {
                 debug!("{:?} has at least one coverage span. Get or make its counter", bcb);
@@ -425,7 +425,7 @@ impl<'a> MakeBcbCounters<'a> {
         traversal: &TraverseCoverageGraphWithLoops<'_>,
         branches: &[BcbBranch],
     ) -> BcbBranch {
-        let good_reloop_branch = self.find_good_reloop_branch(traversal, &branches);
+        let good_reloop_branch = self.find_good_reloop_branch(traversal, branches);
         if let Some(reloop_branch) = good_reloop_branch {
             assert!(self.branch_has_no_counter(&reloop_branch));
             debug!("Selecting reloop branch {reloop_branch:?} to get an expression");
@@ -508,7 +508,7 @@ impl<'a> MakeBcbCounters<'a> {
     fn bcb_branches(&self, from_bcb: BasicCoverageBlock) -> Vec<BcbBranch> {
         self.bcb_successors(from_bcb)
             .iter()
-            .map(|&to_bcb| BcbBranch::from_to(from_bcb, to_bcb, &self.basic_coverage_blocks))
+            .map(|&to_bcb| BcbBranch::from_to(from_bcb, to_bcb, self.basic_coverage_blocks))
             .collect::<Vec<_>>()
     }