From bfbfe639b1c00afe5fd939d3a0b46751ab69cc55 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 3 Aug 2016 19:33:51 -0400 Subject: [PATCH] skip assert-dep-graph unless unit testing this can actually be expensive! --- src/librustc_incremental/assert_dep_graph.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/librustc_incremental/assert_dep_graph.rs b/src/librustc_incremental/assert_dep_graph.rs index 774c5ca6d6b2..420c88e89be0 100644 --- a/src/librustc_incremental/assert_dep_graph.rs +++ b/src/librustc_incremental/assert_dep_graph.rs @@ -71,6 +71,13 @@ pub fn assert_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { dump_graph(tcx); } + // if the `rustc_attrs` feature is not enabled, then the + // attributes we are interested in cannot be present anyway, so + // skip the walk. + if !tcx.sess.features.borrow().rustc_attrs { + return; + } + // Find annotations supplied by user (if any). let (if_this_changed, then_this_would_need) = { let mut visitor = IfThisChanged { tcx: tcx,