Skip to content

Commit 10457ef

Browse files
Rollup merge of rust-lang#116534 - cjgillot:no-dep-tasks, r=davidtwco
Remove -Zdep-tasks. This option is not useful any more, we can use `tracing` and `RUSTC_LOG` to debug the dep-graph.
2 parents 95f6a01 + 8531ebf commit 10457ef

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ fn test_unstable_options_tracking_hash() {
684684
// tidy-alphabetical-start
685685
untracked!(assert_incr_state, Some(String::from("loaded")));
686686
untracked!(deduplicate_diagnostics, false);
687-
untracked!(dep_tasks, true);
688687
untracked!(dont_buffer_diagnostics, true);
689688
untracked!(dump_dep_graph, true);
690689
untracked!(dump_mir, Some(String::from("abc")));

compiler/rustc_query_impl/src/plumbing.rs

-2
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ where
440440
);
441441

442442
if let Some(key) = Q::Key::recover(tcx, &dep_node) {
443-
#[cfg(debug_assertions)]
444-
let _guard = tracing::span!(tracing::Level::TRACE, stringify!($name), ?key).entered();
445443
force_query(query, QueryCtxt::new(tcx), key, dep_node);
446444
true
447445
} else {

compiler/rustc_query_system/src/dep_graph/graph.rs

+4-22
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ impl<D: Deps> DepGraph<D> {
149149
DepNode { kind: D::DEP_KIND_RED, hash: Fingerprint::ZERO.into() },
150150
EdgesVec::new(),
151151
None,
152-
false,
153152
);
154153
assert_eq!(red_node_index, DepNodeIndex::FOREVER_RED_NODE);
155154
match red_node_prev_index_and_color {
@@ -373,16 +372,13 @@ impl<D: Deps> DepGraphData<D> {
373372
let current_fingerprint =
374373
hash_result.map(|f| dcx.with_stable_hashing_context(|mut hcx| f(&mut hcx, &result)));
375374

376-
let print_status = cfg!(debug_assertions) && dcx.sess().opts.unstable_opts.dep_tasks;
377-
378375
// Intern the new `DepNode`.
379376
let (dep_node_index, prev_and_color) = self.current.intern_node(
380377
dcx.profiler(),
381378
&self.previous,
382379
key,
383380
edges,
384381
current_fingerprint,
385-
print_status,
386382
);
387383

388384
hashing_timer.finish_with_query_invocation_id(dep_node_index.into());
@@ -589,16 +585,13 @@ impl<D: Deps> DepGraph<D> {
589585
cx.with_stable_hashing_context(|mut hcx| hash_result(&mut hcx, result))
590586
});
591587

592-
let print_status = cfg!(debug_assertions) && cx.sess().opts.unstable_opts.dep_tasks;
593-
594588
// Intern the new `DepNode` with the dependencies up-to-now.
595589
let (dep_node_index, prev_and_color) = data.current.intern_node(
596590
cx.profiler(),
597591
&data.previous,
598592
node,
599593
edges,
600594
current_fingerprint,
601-
print_status,
602595
);
603596

604597
hashing_timer.finish_with_query_invocation_id(dep_node_index.into());
@@ -1219,20 +1212,13 @@ impl<D: Deps> CurrentDepGraph<D> {
12191212
key: DepNode,
12201213
edges: EdgesVec,
12211214
fingerprint: Option<Fingerprint>,
1222-
print_status: bool,
12231215
) -> (DepNodeIndex, Option<(SerializedDepNodeIndex, DepNodeColor)>) {
1224-
let print_status = cfg!(debug_assertions) && print_status;
1225-
12261216
// Get timer for profiling `DepNode` interning
12271217
let _node_intern_timer =
12281218
self.node_intern_event_id.map(|eid| profiler.generic_activity_with_event_id(eid));
12291219

12301220
if let Some(prev_index) = prev_graph.node_to_index_opt(&key) {
1231-
let get_dep_node_index = |color, fingerprint| {
1232-
if print_status {
1233-
eprintln!("[task::{color:}] {key:?}");
1234-
}
1235-
1221+
let get_dep_node_index = |fingerprint| {
12361222
let mut prev_index_to_index = self.prev_index_to_index.lock();
12371223

12381224
let dep_node_index = match prev_index_to_index[prev_index] {
@@ -1256,27 +1242,23 @@ impl<D: Deps> CurrentDepGraph<D> {
12561242
if fingerprint == prev_graph.fingerprint_by_index(prev_index) {
12571243
// This is a green node: it existed in the previous compilation,
12581244
// its query was re-executed, and it has the same result as before.
1259-
let dep_node_index = get_dep_node_index("green", fingerprint);
1245+
let dep_node_index = get_dep_node_index(fingerprint);
12601246
(dep_node_index, Some((prev_index, DepNodeColor::Green(dep_node_index))))
12611247
} else {
12621248
// This is a red node: it existed in the previous compilation, its query
12631249
// was re-executed, but it has a different result from before.
1264-
let dep_node_index = get_dep_node_index("red", fingerprint);
1250+
let dep_node_index = get_dep_node_index(fingerprint);
12651251
(dep_node_index, Some((prev_index, DepNodeColor::Red)))
12661252
}
12671253
} else {
12681254
// This is a red node, effectively: it existed in the previous compilation
12691255
// session, its query was re-executed, but it doesn't compute a result hash
12701256
// (i.e. it represents a `no_hash` query), so we have no way of determining
12711257
// whether or not the result was the same as before.
1272-
let dep_node_index = get_dep_node_index("unknown", Fingerprint::ZERO);
1258+
let dep_node_index = get_dep_node_index(Fingerprint::ZERO);
12731259
(dep_node_index, Some((prev_index, DepNodeColor::Red)))
12741260
}
12751261
} else {
1276-
if print_status {
1277-
eprintln!("[task::new] {key:?}");
1278-
}
1279-
12801262
let fingerprint = fingerprint.unwrap_or(Fingerprint::ZERO);
12811263

12821264
// This is a new node: it didn't exist in the previous compilation session.

compiler/rustc_session/src/options.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1492,9 +1492,6 @@ options! {
14921492
dep_info_omit_d_target: bool = (false, parse_bool, [TRACKED],
14931493
"in dep-info output, omit targets for tracking dependencies of the dep-info files \
14941494
themselves (default: no)"),
1495-
dep_tasks: bool = (false, parse_bool, [UNTRACKED],
1496-
"print tasks that execute and the color their dep node gets (requires debug build) \
1497-
(default: no)"),
14981495
dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
14991496
"emit diagnostics rather than buffering (breaks NLL error downgrading, sorting) \
15001497
(default: no)"),

0 commit comments

Comments
 (0)