Skip to content

Commit 16d1700

Browse files
arielb1nikomatsakis
authored andcommitted
use dep-graph reads for the evaluation cache
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.
1 parent 14875fd commit 16d1700

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/traits/select.rs

+4
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,10 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
791791
if self.can_use_global_caches(param_env) {
792792
let cache = self.tcx().evaluation_cache.hashmap.borrow();
793793
if let Some(cached) = cache.get(&trait_ref) {
794+
let dep_node = trait_ref
795+
.to_poly_trait_predicate()
796+
.dep_node(self.tcx());
797+
self.tcx().hir.dep_graph.read(dep_node);
794798
return Some(cached.clone());
795799
}
796800
}

0 commit comments

Comments
 (0)