about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-02-24 14:42:14 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-02-24 14:56:29 +0100
commit5ae4500eff740b5935fc24b23e3c4be9789caf37 (patch)
tree1b8221cd2c19f214756edf9f0786aad4972b9087
parent79cd224e758f603898b64308e849fbb9be6e6f4d (diff)
downloadrust-5ae4500eff740b5935fc24b23e3c4be9789caf37.tar.gz
rust-5ae4500eff740b5935fc24b23e3c4be9789caf37.zip
remove redundant clones in librustc_mir_build and librustc_data_structures
-rw-r--r--src/librustc_data_structures/obligation_forest/mod.rs4
-rw-r--r--src/librustc_mir_build/build/matches/mod.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs
index 334daddba88..6711a49b2b7 100644
--- a/src/librustc_data_structures/obligation_forest/mod.rs
+++ b/src/librustc_data_structures/obligation_forest/mod.rs
@@ -314,7 +314,7 @@ impl<O: ForestObligation> ObligationForest<O> {
             return Ok(());
         }
 
-        match self.active_cache.entry(obligation.as_cache_key().clone()) {
+        match self.active_cache.entry(obligation.as_cache_key()) {
             Entry::Occupied(o) => {
                 let node = &mut self.nodes[*o.get()];
                 if let Some(parent_index) = parent {
@@ -385,7 +385,7 @@ impl<O: ForestObligation> ObligationForest<O> {
         self.error_cache
             .entry(node.obligation_tree_id)
             .or_default()
-            .insert(node.obligation.as_cache_key().clone());
+            .insert(node.obligation.as_cache_key());
     }
 
     /// Performs a pass through the obligation list. This must
diff --git a/src/librustc_mir_build/build/matches/mod.rs b/src/librustc_mir_build/build/matches/mod.rs
index f900ae45b94..79951255243 100644
--- a/src/librustc_mir_build/build/matches/mod.rs
+++ b/src/librustc_mir_build/build/matches/mod.rs
@@ -649,7 +649,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                 }
             }
             PatKind::Or { ref pats } => {
-                self.visit_bindings(&pats[0], pattern_user_ty.clone(), f);
+                self.visit_bindings(&pats[0], pattern_user_ty, f);
             }
         }
     }