Skip to content

Commit

Permalink
use dep-graph reads for the evaluation cache
Browse files Browse the repository at this point in the history
This is just duplicating the logic from the old fulfillment cache, so
I'm not sure it is 100% correct, but it should not be more wrong than
the old logic.
  • Loading branch information
arielb1 authored and nikomatsakis committed Jul 7, 2017
1 parent 14875fd commit 16d1700
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,10 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
if self.can_use_global_caches(param_env) {
let cache = self.tcx().evaluation_cache.hashmap.borrow();
if let Some(cached) = cache.get(&trait_ref) {
let dep_node = trait_ref
.to_poly_trait_predicate()
.dep_node(self.tcx());
self.tcx().hir.dep_graph.read(dep_node);
return Some(cached.clone());
}
}
Expand Down

0 comments on commit 16d1700

Please sign in to comment.