about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2017-06-26 18:39:52 +0300
committerNiko Matsakis <niko@alum.mit.edu>2017-07-07 14:03:47 -0400
commit16d1700337e87ab107e6bd08732f0a864c418aae (patch)
treeacea1c69f98c7833c9a2e5d5ab268ada68e12126
parent14875fd3b7d623a21dd252ab80d6e3e6c772151d (diff)
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.
-rw-r--r--src/librustc/traits/select.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs
index 7b1863e8e13..e9a89b1bc37 100644
--- a/src/librustc/traits/select.rs
+++ b/src/librustc/traits/select.rs
@@ -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());
             }
         }