Skip to content

Commit

Permalink
Explain why ensure of a red node == the query
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherjimmy committed Oct 12, 2017
1 parent f03af1b commit d0cb4d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc/ty/maps/plumbing.rs
Expand Up @@ -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 => {
Expand Down

0 comments on commit d0cb4d0

Please sign in to comment.