Skip to content

Commit f995804

Browse files
committed
Move HashResult.
It's the only thing left in `rustc_query_system::query::dispatcher`.
1 parent 541d7fc commit f995804

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

compiler/rustc_middle/src/query/plumbing.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
use std::ops::Deref;
22

3+
use rustc_data_structures::fingerprint::Fingerprint;
34
use rustc_data_structures::sync::{AtomicU64, WorkerLocal};
45
use rustc_hir::def_id::{DefId, LocalDefId};
56
use rustc_hir::hir_id::OwnerId;
67
use rustc_macros::HashStable;
78
use rustc_query_system::dep_graph::{DepNodeIndex, SerializedDepNodeIndex};
9+
use rustc_query_system::ich::StableHashingContext;
810
pub(crate) use rustc_query_system::query::QueryJobId;
9-
use rustc_query_system::query::{CycleError, CycleErrorHandling, HashResult, QueryCache};
11+
use rustc_query_system::query::{CycleError, CycleErrorHandling, QueryCache};
1012
use rustc_span::{ErrorGuaranteed, Span};
1113
pub use sealed::IntoQueryParam;
1214

@@ -30,6 +32,8 @@ pub type TryLoadFromDiskFn<'tcx, Key, Value> = fn(
3032
pub type IsLoadableFromDiskFn<'tcx, Key> =
3133
fn(tcx: TyCtxt<'tcx>, key: &Key, index: SerializedDepNodeIndex) -> bool;
3234

35+
pub type HashResult<V> = Option<fn(&mut StableHashingContext<'_>, &V) -> Fingerprint>;
36+
3337
/// Stores function pointers and other metadata for a particular query.
3438
///
3539
/// Used indirectly by query plumbing in `rustc_query_system` via a trait,

compiler/rustc_query_impl/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use rustc_middle::queries::{
1818
};
1919
use rustc_middle::query::AsLocalKey;
2020
use rustc_middle::query::on_disk_cache::{CacheEncoder, EncodedDepNodeIndex, OnDiskCache};
21-
use rustc_middle::query::plumbing::{QuerySystem, QuerySystemFns, QueryVTable};
21+
use rustc_middle::query::plumbing::{HashResult, QuerySystem, QuerySystemFns, QueryVTable};
2222
use rustc_middle::query::values::Value;
2323
use rustc_middle::ty::TyCtxt;
2424
use rustc_query_system::dep_graph::SerializedDepNodeIndex;
2525
use rustc_query_system::query::{
26-
CycleError, CycleErrorHandling, HashResult, QueryCache, QueryMap, QueryMode, QueryState,
26+
CycleError, CycleErrorHandling, QueryCache, QueryMap, QueryMode, QueryState,
2727
};
2828
use rustc_span::{ErrorGuaranteed, Span};
2929

compiler/rustc_query_system/src/query/dispatcher.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

compiler/rustc_query_system/src/query/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use rustc_span::def_id::DefId;
1515
pub use self::caches::{
1616
DefIdCache, DefaultCache, QueryCache, QueryCacheKey, SingleCache, VecCache,
1717
};
18-
pub use self::dispatcher::HashResult;
1918
pub use self::job::{
2019
QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryLatch, QueryMap, break_query_cycles,
2120
print_query_stack, report_cycle,
@@ -24,7 +23,6 @@ pub use self::plumbing::*;
2423
use crate::dep_graph::{DepKind, DepNodeIndex, HasDepContext, SerializedDepNodeIndex};
2524

2625
mod caches;
27-
mod dispatcher;
2826
mod job;
2927
mod plumbing;
3028

0 commit comments

Comments
 (0)