Don't try to promote queries that never cache to disk

This commit is contained in:
Zalathar
2026-02-26 18:20:06 +11:00
parent f7ac4266f5
commit 08df254a60
2 changed files with 4 additions and 1 deletions
@@ -104,6 +104,7 @@ pub(crate) fn Metadata<'tcx>() -> DepKindVTable<'tcx> {
/// Called from macro-generated code for each query.
pub(crate) fn make_dep_kind_vtable_for_query<'tcx, Q>(
is_anon: bool,
is_cache_on_disk: bool,
is_eval_always: bool,
) -> DepKindVTable<'tcx>
where
@@ -127,7 +128,8 @@ pub(crate) fn make_dep_kind_vtable_for_query<'tcx, Q>(
is_eval_always,
key_fingerprint_style,
force_from_dep_node_fn: can_recover.then_some(force_from_dep_node_inner::<Q>),
promote_from_disk_fn: can_recover.then_some(promote_from_disk_inner::<Q>),
promote_from_disk_fn: (can_recover && is_cache_on_disk)
.then_some(promote_from_disk_inner::<Q>),
}
}
@@ -697,6 +697,7 @@ pub(crate) fn $name<'tcx>() -> DepKindVTable<'tcx> {
use $crate::query_impl::$name::VTableGetter;
make_dep_kind_vtable_for_query::<VTableGetter>(
is_anon!([$($modifiers)*]),
if_cache_on_disk!([$($modifiers)*] true false),
is_eval_always!([$($modifiers)*]),
)
}