diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-02-25 22:15:30 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-02-26 23:35:52 +0100 |
| commit | 3b26d71e04fd61deb42656b28371e097ab35c4aa (patch) | |
| tree | 9409204a148fcbd02b41383245cd49564d61b9a2 /compiler | |
| parent | 3fd7c4a17d5c2b56dcd10adc8ee692abcc3be7f9 (diff) | |
| download | rust-3b26d71e04fd61deb42656b28371e097ab35c4aa.tar.gz rust-3b26d71e04fd61deb42656b28371e097ab35c4aa.zip | |
Avoid implementing Debug for QueryConfig
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/mod.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/query/config.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/query/plumbing.rs | 6 |
4 files changed, 14 insertions, 5 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index c37dcc048d2..dfe172fc3ff 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -462,7 +462,7 @@ macro_rules! define_queries { use std::marker::PhantomData; $( - #[derive(Copy, Clone, Debug)] + #[derive(Copy, Clone)] pub struct $name<'tcx> { data: PhantomData<&'tcx ()> } diff --git a/compiler/rustc_query_system/src/dep_graph/mod.rs b/compiler/rustc_query_system/src/dep_graph/mod.rs index 6969f2dbef8..ba83b775631 100644 --- a/compiler/rustc_query_system/src/dep_graph/mod.rs +++ b/compiler/rustc_query_system/src/dep_graph/mod.rs @@ -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. #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum FingerprintStyle { diff --git a/compiler/rustc_query_system/src/query/config.rs b/compiler/rustc_query_system/src/query/config.rs index 939f509e994..e44a00ca6cb 100644 --- a/compiler/rustc_query_system/src/query/config.rs +++ b/compiler/rustc_query_system/src/query/config.rs @@ -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 trait QueryConfig<Qcx: QueryContext>: Copy + Debug { +pub trait QueryConfig<Qcx: QueryContext>: Copy { fn name(self) -> &'static str; // `Key` and `Value` are `Copy` instead of `Clone` to ensure copying them stays cheap, diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index b801951ae74..6eecda09a32 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -468,9 +468,9 @@ where dep_graph.with_task( dep_node, - qcx, - (key, query), - |qcx, (key, query)| query.compute(qcx, key), + (qcx, query), + key, + |(qcx, query), key| query.compute(qcx, key), query.hash_result(), ) }); |
