Skip to content

Commit d0cb4d0

Browse files
committed
Explain why ensure of a red node == the query
1 parent f03af1b commit d0cb4d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc/ty/maps/plumbing.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,12 @@ macro_rules! define_maps {
363363
tcx.dep_graph.read_index(dep_node_index);
364364
}
365365
Some(DepNodeColor::Red) => {
366+
// A DepNodeColor::Red DepNode means that this query was executed
367+
// before. We can not call `dep_graph.read()` here as we don't have
368+
// the DepNodeIndex. Instead, We call the query again to issue the
369+
// appropriate `dep_graph.read()` call. The performance cost this
370+
// introduces should be negligible as we'll immediately hit the
371+
// in-memory cache.
366372
let _ = tcx.$name(key);
367373
}
368374
None => {

0 commit comments

Comments
 (0)