diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index b51c290039938..d5e870bb28d75 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -334,10 +334,12 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) })?; - tcx.sess.track_errors(|| { - time(tcx.sess, "outlives testing", || - outlives::test::test_inferred_outlives(tcx)); - })?; + if tcx.features().rustc_attrs { + tcx.sess.track_errors(|| { + time(tcx.sess, "outlives testing", || + outlives::test::test_inferred_outlives(tcx)); + })?; + } tcx.sess.track_errors(|| { time(tcx.sess, "impl wf inference", || @@ -349,10 +351,12 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) coherence::check_coherence(tcx)); })?; - tcx.sess.track_errors(|| { - time(tcx.sess, "variance testing", || - variance::test::test_variance(tcx)); - })?; + if tcx.features().rustc_attrs { + tcx.sess.track_errors(|| { + time(tcx.sess, "variance testing", || + variance::test::test_variance(tcx)); + })?; + } time(tcx.sess, "wf checking", || check::check_wf_new(tcx))?;