Skip to content

Commit 076dc9b

Browse files
committed
Remove the tcx parameter from will_cache_on_disk_for_key_fn
1 parent a7d2a68 commit 076dc9b

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

‎compiler/rustc_middle/src/query/plumbing.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub struct QueryVTable<'tcx, C: QueryCache> {
9797
/// This should be the only code that calls the provider function.
9898
pub invoke_provider_fn: fn(tcx: TyCtxt<'tcx>, key: C::Key) -> C::Value,
9999

100-
pub will_cache_on_disk_for_key_fn: fn(tcx: TyCtxt<'tcx>, key: C::Key) -> bool,
100+
pub will_cache_on_disk_for_key_fn: fn(key: C::Key) -> bool,
101101

102102
pub try_load_from_disk_fn: fn(
103103
tcx: TyCtxt<'tcx>,

‎compiler/rustc_query_impl/src/execution.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ fn ensure_can_skip_execution<'tcx, C: QueryCache>(
576576
// needed, which guarantees the query provider will never run
577577
// for this key.
578578
EnsureMode::Done => {
579-
(query.will_cache_on_disk_for_key_fn)(tcx, key)
579+
(query.will_cache_on_disk_for_key_fn)(key)
580580
&& loadable_from_disk(tcx, serialized_dep_node_index)
581581
}
582582
}

‎compiler/rustc_query_impl/src/plumbing.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn encode_query_values_inner<'a, 'tcx, C, V>(
9393

9494
assert!(all_inactive(&query.state));
9595
query.cache.for_each(&mut |key, value, dep_node| {
96-
if (query.will_cache_on_disk_for_key_fn)(tcx, *key) {
96+
if (query.will_cache_on_disk_for_key_fn)(*key) {
9797
encoder.encode_query_value::<V>(dep_node, &erase::restore_val::<V>(*value));
9898
}
9999
});
@@ -152,7 +152,7 @@ pub(crate) fn promote_from_disk_inner<'tcx, C: QueryCache>(
152152

153153
// If the recovered key isn't eligible for cache-on-disk, then there's no
154154
// value on disk to promote.
155-
if !(query.will_cache_on_disk_for_key_fn)(tcx, key) {
155+
if !(query.will_cache_on_disk_for_key_fn)(key) {
156156
return;
157157
}
158158

‎compiler/rustc_query_impl/src/query_impl.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ macro_rules! define_queries {
126126
}
127127

128128
fn will_cache_on_disk_for_key<'tcx>(
129-
_tcx: TyCtxt<'tcx>,
130129
_key: rustc_middle::queries::$name::Key<'tcx>,
131130
) -> bool {
132131
cfg_select! {
@@ -164,7 +163,7 @@ macro_rules! define_queries {
164163
use rustc_middle::queries::$name::{ProvidedValue, provided_to_erased};
165164

166165
// Check the cache-on-disk condition for this key.
167-
if !$crate::query_impl::$name::will_cache_on_disk_for_key(tcx, key) {
166+
if !$crate::query_impl::$name::will_cache_on_disk_for_key(key) {
168167
return None;
169168
}
170169

0 commit comments

Comments
 (0)