Retire rustc_dep_node_try_load_from_on_disk_cache.
This commit is contained in:
parent
e853cc0b28
commit
57ba8edb9e
2 changed files with 23 additions and 27 deletions
|
@ -210,7 +210,29 @@ pub fn force_from_dep_node<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> bool
|
|||
}
|
||||
|
||||
pub(crate) fn try_load_from_on_disk_cache<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) {
|
||||
rustc_dep_node_try_load_from_on_disk_cache!(dep_node, tcx)
|
||||
macro_rules! try_load_from_on_disk_cache {
|
||||
($($name:ident,)*) => {
|
||||
match dep_node.kind {
|
||||
$(DepKind::$name => {
|
||||
if <query_keys::$name<'tcx> as DepNodeParams<TyCtxt<'_>>>::can_reconstruct_query_key() {
|
||||
debug_assert!(tcx.dep_graph
|
||||
.node_color(dep_node)
|
||||
.map(|c| c.is_green())
|
||||
.unwrap_or(false));
|
||||
|
||||
let key = <query_keys::$name<'tcx> as DepNodeParams<TyCtxt<'_>>>::recover(tcx, dep_node).unwrap();
|
||||
if queries::$name::cache_on_disk(tcx, &key, None) {
|
||||
let _ = tcx.$name(key);
|
||||
}
|
||||
}
|
||||
})*
|
||||
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rustc_cached_queries!(try_load_from_on_disk_cache!);
|
||||
}
|
||||
|
||||
mod sealed {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue