about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2021-05-18 07:48:00 -0400
committerTamir Duberstein <tamird@google.com>2021-05-18 07:48:00 -0400
commita36c6361999ff23d604a5a0e7d06611ad31b6262 (patch)
treec4a37301d1e7bcaa8e3f7b5e92399fc5fe5927f4
parent5f10d310f475b3ba583b9c590b8d19f6c2fde28f (diff)
downloadrust-a36c6361999ff23d604a5a0e7d06611ad31b6262.tar.gz
rust-a36c6361999ff23d604a5a0e7d06611ad31b6262.zip
Avoid cloning cache key
-rw-r--r--compiler/rustc_data_structures/src/obligation_forest/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/obligation_forest/mod.rs b/compiler/rustc_data_structures/src/obligation_forest/mod.rs
index 29d685ab530..74ceed67807 100644
--- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs
+++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs
@@ -342,7 +342,7 @@ impl<O: ForestObligation> ObligationForest<O> {
             return Ok(());
         }
 
-        match self.active_cache.entry(cache_key.clone()) {
+        match self.active_cache.entry(cache_key) {
             Entry::Occupied(o) => {
                 let node = &mut self.nodes[*o.get()];
                 if let Some(parent_index) = parent {
@@ -366,7 +366,7 @@ impl<O: ForestObligation> ObligationForest<O> {
                     && self
                         .error_cache
                         .get(&obligation_tree_id)
-                        .map(|errors| errors.contains(&cache_key))
+                        .map(|errors| errors.contains(v.key()))
                         .unwrap_or(false);
 
                 if already_failed {