Skip to content

Commit eb3a527

Browse files
Address review comments
1 parent 03f2cf2 commit eb3a527

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

compiler/rustc_lint/src/levels.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ use rustc_span::symbol::{sym, Symbol};
2626
use rustc_span::{source_map::MultiSpan, Span, DUMMY_SP};
2727
use tracing::debug;
2828

29-
use std::cmp;
30-
3129
fn lint_levels(tcx: TyCtxt<'_>, (): ()) -> LintLevelMap {
3230
let store = unerased_lint_store(tcx);
3331
let crate_attrs = tcx.hir().attrs(CRATE_HIR_ID);
@@ -91,12 +89,6 @@ impl<'s> LintLevelsBuilder<'s> {
9189
for &(ref lint_name, level) in &sess.opts.lint_opts {
9290
store.check_lint_name_cmdline(sess, &lint_name, level, self.crate_attrs);
9391
let orig_level = level;
94-
95-
// If the cap is less than this specified level, e.g., if we've got
96-
// `--cap-lints allow` but we've also got `-D foo` then we ignore
97-
// this specification as the lint cap will set it to allow anyway.
98-
let level = cmp::min(level, self.sets.lint_cap);
99-
10092
let lint_flag_val = Symbol::intern(lint_name);
10193

10294
let ids = match store.find_lints(&lint_name) {
@@ -105,9 +97,8 @@ impl<'s> LintLevelsBuilder<'s> {
10597
};
10698
for id in ids {
10799
// ForceWarn and Forbid cannot be overriden
108-
match specs.get(&id) {
109-
Some((Level::ForceWarn | Level::Forbid, _)) => continue,
110-
_ => (),
100+
if let Some((Level::ForceWarn | Level::Forbid, _)) = specs.get(&id) {
101+
continue;
111102
}
112103

113104
self.check_gated_lint(id, DUMMY_SP);

0 commit comments

Comments
 (0)