Avoid implementing Debug for QueryConfig

This commit is contained in:
John Kåre Alsaker 2023-02-25 22:15:30 +01:00
parent 3fd7c4a17d
commit 3b26d71e04
4 changed files with 14 additions and 5 deletions

View file

@ -462,7 +462,7 @@ macro_rules! define_queries {
use std::marker::PhantomData; use std::marker::PhantomData;
$( $(
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone)]
pub struct $name<'tcx> { pub struct $name<'tcx> {
data: PhantomData<&'tcx ()> data: PhantomData<&'tcx ()>
} }

View file

@ -88,6 +88,15 @@ impl<T: DepContext> HasDepContext for T {
} }
} }
impl<T: HasDepContext, Q: Copy> HasDepContext for (T, Q) {
type DepKind = T::DepKind;
type DepContext = T::DepContext;
fn dep_context(&self) -> &Self::DepContext {
self.0.dep_context()
}
}
/// Describes the contents of the fingerprint generated by a given query. /// Describes the contents of the fingerprint generated by a given query.
#[derive(Debug, PartialEq, Eq, Copy, Clone)] #[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum FingerprintStyle { pub enum FingerprintStyle {

View file

@ -14,7 +14,7 @@ pub type HashResult<V> = Option<fn(&mut StableHashingContext<'_>, &V) -> Fingerp
pub type TryLoadFromDisk<Qcx, V> = Option<fn(Qcx, SerializedDepNodeIndex) -> Option<V>>; pub type TryLoadFromDisk<Qcx, V> = Option<fn(Qcx, SerializedDepNodeIndex) -> Option<V>>;
pub trait QueryConfig<Qcx: QueryContext>: Copy + Debug { pub trait QueryConfig<Qcx: QueryContext>: Copy {
fn name(self) -> &'static str; fn name(self) -> &'static str;
// `Key` and `Value` are `Copy` instead of `Clone` to ensure copying them stays cheap, // `Key` and `Value` are `Copy` instead of `Clone` to ensure copying them stays cheap,

View file

@ -468,9 +468,9 @@ where
dep_graph.with_task( dep_graph.with_task(
dep_node, dep_node,
qcx, (qcx, query),
(key, query), key,
|qcx, (key, query)| query.compute(qcx, key), |(qcx, query), key| query.compute(qcx, key),
query.hash_result(), query.hash_result(),
) )
}); });