Skip to content

Commit b3bcf4a

Browse files
authored
Rollup merge of #85436 - tamird:save-clone, r=estebank
Avoid cloning cache key r? `@estebank`
2 parents 9a57617 + 42b9d3f commit b3bcf4a

File tree

1 file changed

+2
-3
lines changed
  • compiler/rustc_data_structures/src/obligation_forest

1 file changed

+2
-3
lines changed

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl<O: ForestObligation> ObligationForest<O> {
342342
return Ok(());
343343
}
344344

345-
match self.active_cache.entry(cache_key.clone()) {
345+
match self.active_cache.entry(cache_key) {
346346
Entry::Occupied(o) => {
347347
let node = &mut self.nodes[*o.get()];
348348
if let Some(parent_index) = parent {
@@ -366,8 +366,7 @@ impl<O: ForestObligation> ObligationForest<O> {
366366
&& self
367367
.error_cache
368368
.get(&obligation_tree_id)
369-
.map(|errors| errors.contains(&cache_key))
370-
.unwrap_or(false);
369+
.map_or(false, |errors| errors.contains(v.key()));
371370

372371
if already_failed {
373372
Err(())

0 commit comments

Comments
 (0)