Skip to content

Commit 37378ee

Browse files
authored
Rollup merge of rust-lang#106912 - gftea:pr-106736, r=Nilstrieb
check -Z query-dep-graph is enabled if -Z dump-dep-graph (rust-lang#106736) PR to solve rust-lang#106736, r? `@cjgillot`
2 parents 8ea26ca + 2c5583e commit 37378ee

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

compiler/rustc_session/src/config.rs

+5
Original file line numberDiff line numberDiff line change
@@ -2459,6 +2459,11 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
24592459

24602460
let pretty = parse_pretty(&unstable_opts, error_format);
24612461

2462+
// query-dep-graph is required if dump-dep-graph is given #106736
2463+
if unstable_opts.dump_dep_graph && !unstable_opts.query_dep_graph {
2464+
early_error(error_format, "can't dump dependency graph without `-Z query-dep-graph`");
2465+
}
2466+
24622467
// Try to find a directory containing the Rust `src`, for more details see
24632468
// the doc comment on the `real_rust_source_base_dir` field.
24642469
let tmp_buf;

tests/ui/dep-graph/dep-graph-dump.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Test dump-dep-graph requires query-dep-graph enabled
2+
3+
// incremental
4+
// compile-flags: -Z dump-dep-graph
5+
6+
fn main() {}
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: can't dump dependency graph without `-Z query-dep-graph`
2+

0 commit comments

Comments
 (0)