Inline TyCtxt::load_side_effect into its only caller

This commit is contained in:
Zalathar
2026-03-23 15:59:45 +11:00
parent afffa7d6e3
commit db19c0c3ee
2 changed files with 8 additions and 13 deletions
+7 -12
View File
@@ -718,7 +718,13 @@ fn encode_side_effect<'tcx>(
#[inline]
fn force_side_effect<'tcx>(&self, tcx: TyCtxt<'tcx>, prev_index: SerializedDepNodeIndex) {
with_deps(TaskDepsRef::Ignore, || {
let side_effect = tcx.load_side_effect(prev_index).unwrap();
let side_effect = tcx
.query_system
.on_disk_cache
.as_ref()
.unwrap()
.load_side_effect(tcx, prev_index)
.unwrap();
// Use `send_and_color` as `promote_node_and_deps_to_current` expects all
// green dependencies. `send_and_color` will also prevent multiple nodes
@@ -1549,15 +1555,4 @@ impl<'tcx> TyCtxt<'tcx> {
fn is_eval_always(self, kind: DepKind) -> bool {
self.dep_kind_vtable(kind).is_eval_always
}
// Interactions with on_disk_cache
fn load_side_effect(
self,
prev_dep_node_index: SerializedDepNodeIndex,
) -> Option<QuerySideEffect> {
self.query_system
.on_disk_cache
.as_ref()
.and_then(|c| c.load_side_effect(self, prev_dep_node_index))
}
}
@@ -325,7 +325,7 @@ pub fn serialize(tcx: TyCtxt<'_>, encoder: FileEncoder) -> FileEncodeResult {
}
/// Loads a `QuerySideEffect` created during the previous compilation session.
pub fn load_side_effect(
pub(crate) fn load_side_effect(
&self,
tcx: TyCtxt<'_>,
dep_node_index: SerializedDepNodeIndex,