Add #[rustc_clean(loaded_from_disk)] to assert loading of query result

Currently, you can use `#[rustc_clean]` to assert to that a particular
query (technically, a `DepNode`) is green or red. However, a green
`DepNode` does not mean that the query result was actually deserialized
from disk - we might have never re-run a query that needed the result.

Some incremental tests are written as regression tests for ICEs that
occured during query result decoding. Using
`#[rustc_clean(loaded_from_disk="typeck")]`, you can now assert
that the result of a particular query (e.g. `typeck`) was actually
loaded from disk, in addition to being green.
This commit is contained in:
Aaron Hill
2021-12-21 16:31:35 -05:00
parent e100ec5bc7
commit f1d682334d
5 changed files with 64 additions and 3 deletions

View File

@@ -519,6 +519,10 @@ where
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
if let Some(result) = result {
if unlikely!(tcx.dep_context().sess().opts.debugging_opts.query_dep_graph) {
dep_graph.mark_debug_loaded_from_disk(*dep_node)
}
let prev_fingerprint = tcx
.dep_context()
.dep_graph()