Skip to content

Commit

Permalink
Only enable assert_dep_graph when query-dep-graph is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Mar 22, 2021
1 parent d04c3aa commit 219603a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_incremental/src/assert_dep_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ pub fn assert_dep_graph(tcx: TyCtxt<'_>) {
dump_graph(tcx);
}

if !tcx.sess.opts.debugging_opts.query_dep_graph {
return;
}

// if the `rustc_attrs` feature is not enabled, then the
// attributes we are interested in cannot be present anyway, so
// skip the walk.
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_incremental/src/persist/dirty_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ impl Assertion {
}

pub fn check_dirty_clean_annotations(tcx: TyCtxt<'_>) {
if !tcx.sess.opts.debugging_opts.query_dep_graph {
return;
}

// can't add `#[rustc_dirty]` etc without opting in to this feature
if !tcx.features().rustc_attrs {
return;
Expand Down

0 comments on commit 219603a

Please sign in to comment.