Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check -Z query-dep-graph is enabled if -Z dump-dep-graph (#106736) #106912

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2459,6 +2459,11 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {

let pretty = parse_pretty(&unstable_opts, error_format);

// query-dep-graph is required if dump-dep-graph is given #106736
if unstable_opts.dump_dep_graph && !unstable_opts.query_dep_graph {
early_error(error_format, "can't dump dependency graph without `-Z query-dep-graph`");
}

// Try to find a directory containing the Rust `src`, for more details see
// the doc comment on the `real_rust_source_base_dir` field.
let tmp_buf;
Expand Down
6 changes: 6 additions & 0 deletions tests/ui/dep-graph/dep-graph-dump.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Test dump-dep-graph requires query-dep-graph enabled

// incremental
// compile-flags: -Z dump-dep-graph

fn main() {}
2 changes: 2 additions & 0 deletions tests/ui/dep-graph/dep-graph-dump.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: can't dump dependency graph without `-Z query-dep-graph`