Skip to content

Commit 222d010

Browse files
committedMar 27, 2020
Cleanups.
1 parent db5be1f commit 222d010

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed
 

‎src/librustc/dep_graph/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ impl<'tcx> DepContext for TyCtxt<'tcx> {
9595
TyCtxt::create_stable_hashing_context(*self)
9696
}
9797

98+
fn debug_dep_tasks(&self) -> bool {
99+
self.sess.opts.debugging_opts.dep_tasks
100+
}
101+
98102
fn try_force_from_dep_node(&self, dep_node: &DepNode) -> bool {
99103
// FIXME: This match is just a workaround for incremental bugs and should
100104
// be removed. https://github.com/rust-lang/rust/issues/62649 is one such
@@ -181,8 +185,4 @@ fn def_id_corresponds_to_hir_dep_node(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
181185
def_id.index == hir_id.owner.local_def_index
182186
}
183187

184-
impl rustc_query_system::HashStableContext for StableHashingContext<'_> {
185-
fn debug_dep_tasks(&self) -> bool {
186-
self.sess().opts.debugging_opts.dep_tasks
187-
}
188-
}
188+
impl rustc_query_system::HashStableContext for StableHashingContext<'_> {}

‎src/librustc/ty/query/plumbing.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ macro_rules! is_eval_always {
209209
}
210210

211211
macro_rules! query_storage {
212-
(<$tcx:tt>[][$K:ty, $V:ty]) => {
212+
([][$K:ty, $V:ty]) => {
213213
<<$K as Key>::CacheSelector as CacheSelector<$K, $V>>::Cache
214214
};
215-
(<$tcx:tt>[storage($ty:ty) $($rest:tt)*][$K:ty, $V:ty]) => {
215+
([storage($ty:ty) $($rest:tt)*][$K:ty, $V:ty]) => {
216216
$ty
217217
};
218-
(<$tcx:tt>[$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)*][$($args:tt)*]) => {
219-
query_storage!(<$tcx>[$($($modifiers)*)*][$($args)*])
218+
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)*][$($args:tt)*]) => {
219+
query_storage!([$($($modifiers)*)*][$($args)*])
220220
};
221221
}
222222

@@ -332,7 +332,7 @@ macro_rules! define_queries_inner {
332332
const EVAL_ALWAYS: bool = is_eval_always!([$($modifiers)*]);
333333
const DEP_KIND: dep_graph::DepKind = dep_graph::DepKind::$node;
334334

335-
type Cache = query_storage!(<$tcx>[$($modifiers)*][$K, $V]);
335+
type Cache = query_storage!([$($modifiers)*][$K, $V]);
336336

337337
#[inline(always)]
338338
fn query_state<'a>(tcx: TyCtxt<$tcx>) -> &'a QueryState<TyCtxt<$tcx>, Self::Cache> {

‎src/librustc_query_system/dep_graph/graph.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use super::prev::PreviousDepGraph;
2222
use super::query::DepGraphQuery;
2323
use super::serialized::{SerializedDepGraph, SerializedDepNodeIndex};
2424
use super::{DepContext, DepKind, DepNode, WorkProductId};
25-
use crate::HashStableContext;
2625

2726
#[derive(Clone)]
2827
pub struct DepGraph<K: DepKind> {
@@ -259,7 +258,7 @@ impl<K: DepKind> DepGraph<K> {
259258
task_deps.map(|lock| lock.into_inner()),
260259
);
261260

262-
let print_status = cfg!(debug_assertions) && hcx.debug_dep_tasks();
261+
let print_status = cfg!(debug_assertions) && cx.debug_dep_tasks();
263262

264263
// Determine the color of the new DepNode.
265264
if let Some(prev_index) = data.previous.node_to_index_opt(&key) {

‎src/librustc_query_system/dep_graph/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ pub trait DepContext: Copy {
2727
/// Create a hashing context for hashing new results.
2828
fn create_stable_hashing_context(&self) -> Self::StableHashingContext;
2929

30+
fn debug_dep_tasks(&self) -> bool;
31+
3032
/// Try to force a dep node to execute and see if it's green.
3133
fn try_force_from_dep_node(&self, dep_node: &DepNode<Self::DepKind>) -> bool;
3234

‎src/librustc_query_system/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ extern crate rustc_data_structures;
1616
pub mod dep_graph;
1717
pub mod query;
1818

19-
pub trait HashStableContext {
20-
fn debug_dep_tasks(&self) -> bool;
21-
}
19+
pub trait HashStableContext {}

0 commit comments

Comments
 (0)