Skip to content

Commit 3b26d71

Browse files
committed
Avoid implementing Debug for QueryConfig
1 parent 3fd7c4a commit 3b26d71

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

compiler/rustc_query_impl/src/plumbing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ macro_rules! define_queries {
462462
use std::marker::PhantomData;
463463

464464
$(
465-
#[derive(Copy, Clone, Debug)]
465+
#[derive(Copy, Clone)]
466466
pub struct $name<'tcx> {
467467
data: PhantomData<&'tcx ()>
468468
}

compiler/rustc_query_system/src/dep_graph/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ impl<T: DepContext> HasDepContext for T {
8888
}
8989
}
9090

91+
impl<T: HasDepContext, Q: Copy> HasDepContext for (T, Q) {
92+
type DepKind = T::DepKind;
93+
type DepContext = T::DepContext;
94+
95+
fn dep_context(&self) -> &Self::DepContext {
96+
self.0.dep_context()
97+
}
98+
}
99+
91100
/// Describes the contents of the fingerprint generated by a given query.
92101
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
93102
pub enum FingerprintStyle {

compiler/rustc_query_system/src/query/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub type HashResult<V> = Option<fn(&mut StableHashingContext<'_>, &V) -> Fingerp
1414

1515
pub type TryLoadFromDisk<Qcx, V> = Option<fn(Qcx, SerializedDepNodeIndex) -> Option<V>>;
1616

17-
pub trait QueryConfig<Qcx: QueryContext>: Copy + Debug {
17+
pub trait QueryConfig<Qcx: QueryContext>: Copy {
1818
fn name(self) -> &'static str;
1919

2020
// `Key` and `Value` are `Copy` instead of `Clone` to ensure copying them stays cheap,

compiler/rustc_query_system/src/query/plumbing.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,9 @@ where
468468

469469
dep_graph.with_task(
470470
dep_node,
471-
qcx,
472-
(key, query),
473-
|qcx, (key, query)| query.compute(qcx, key),
471+
(qcx, query),
472+
key,
473+
|(qcx, query), key| query.compute(qcx, key),
474474
query.hash_result(),
475475
)
476476
});

0 commit comments

Comments
 (0)