Only enable assert_dep_graph when query-dep-graph is enabled.

This commit is contained in:
Camille GILLOT 2021-03-20 02:14:04 +01:00
parent d04c3aa865
commit 219603a958
2 changed files with 8 additions and 0 deletions

View File

@ -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.

View File

@ -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;