about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJimmy Brisson <theotherjimmy@gmail.com>2017-10-12 08:54:42 -0500
committerJimmy Brisson <theotherjimmy@gmail.com>2017-10-12 08:54:42 -0500
commitd0cb4d09cd4eb7626130cc9e59ef69dbfec04d0e (patch)
tree215fd4e466d90ddcf371aaa2449535bd78e1b132 /src
parentf03af1b8f1be0fdb04cc9d641e2777ff3a6ec817 (diff)
downloadrust-d0cb4d09cd4eb7626130cc9e59ef69dbfec04d0e.tar.gz
rust-d0cb4d09cd4eb7626130cc9e59ef69dbfec04d0e.zip
Explain why `ensure` of a red node == the query
Diffstat (limited to 'src')
-rw-r--r--src/librustc/ty/maps/plumbing.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc/ty/maps/plumbing.rs b/src/librustc/ty/maps/plumbing.rs
index 57e3e0496e2..715d5993fc5 100644
--- a/src/librustc/ty/maps/plumbing.rs
+++ b/src/librustc/ty/maps/plumbing.rs
@@ -363,6 +363,12 @@ macro_rules! define_maps {
                         tcx.dep_graph.read_index(dep_node_index);
                     }
                     Some(DepNodeColor::Red) => {
+                        // A DepNodeColor::Red DepNode means that this query was executed
+                        // before. We can not call `dep_graph.read()` here as we don't have
+                        // the DepNodeIndex. Instead, We call the query again to issue the
+                        // appropriate `dep_graph.read()` call. The performance cost this
+                        // introduces should be negligible as we'll immediately hit the
+                        // in-memory cache.
                         let _ = tcx.$name(key);
                     }
                     None => {