Skip to content

Commit cdb446f

Browse files
committed
Streamline active_cache to done_cache transfer.
1 parent fee3a45 commit cdb446f

File tree

1 file changed

+5
-8
lines changed
  • compiler/rustc_data_structures/src/obligation_forest

1 file changed

+5
-8
lines changed

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -634,17 +634,14 @@ impl<O: ForestObligation> ObligationForest<O> {
634634
}
635635
}
636636
NodeState::Done => {
637-
// This lookup can fail because the contents of
637+
// The removal lookup might fail because the contents of
638638
// `self.active_cache` are not guaranteed to match those of
639639
// `self.nodes`. See the comment in `process_obligation`
640640
// for more details.
641-
if let Some((predicate, _)) =
642-
self.active_cache.remove_entry(&node.obligation.as_cache_key())
643-
{
644-
self.done_cache.insert(predicate);
645-
} else {
646-
self.done_cache.insert(node.obligation.as_cache_key().clone());
647-
}
641+
let cache_key = node.obligation.as_cache_key();
642+
self.active_cache.remove(&cache_key);
643+
self.done_cache.insert(cache_key);
644+
648645
// Extract the success stories.
649646
outcome_cb(&node.obligation);
650647
node_rewrites[index] = orig_nodes_len;

0 commit comments

Comments
 (0)