From 4093bec80d39f94d69754d3a30cb14d9d4954424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Tue, 26 Mar 2019 17:04:00 +0100 Subject: [PATCH] Exclude UnusedBrokenConst from module lints --- src/librustc_lint/builtin.rs | 1 + src/librustc_lint/lib.rs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 304e6eb712e3..492ac1bf14dc 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -1360,6 +1360,7 @@ fn check_const(cx: &LateContext<'_, '_>, body_id: hir::BodyId) { promoted: None }; // trigger the query once for all constants since that will already report the errors + // FIXME: Use ensure here let _ = cx.tcx.const_eval(param_env.and(cid)); } diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 2caaa0159921..4c624a267af9 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -153,9 +153,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) { TypeAliasBounds: TypeAliasBounds, - // May Depend on constants elsewhere - UnusedBrokenConst: UnusedBrokenConst, - TrivialConstraints: TrivialConstraints, TypeLimits: TypeLimits::new(), @@ -171,6 +168,10 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) { store.register_late_pass(sess, false, true, box BuiltinCombinedModuleLateLintPass::new()); late_lint_methods!(declare_combined_late_lint_pass, [BuiltinCombinedLateLintPass, [ + // FIXME: Look into regression when this is used as a module lint + // May Depend on constants elsewhere + UnusedBrokenConst: UnusedBrokenConst, + // Uses attr::is_used which is untracked, can't be an incremental module pass. UnusedAttributes: UnusedAttributes,