Skip to content

Commit

Permalink
Exclude UnusedBrokenConst from module lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 26, 2019
1 parent 00d8fa3 commit 4093bec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
7 changes: 4 additions & 3 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),

Expand All @@ -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,

Expand Down

0 comments on commit 4093bec

Please sign in to comment.