@@ -26,8 +26,6 @@ use rustc_span::symbol::{sym, Symbol};
26
26
use rustc_span:: { source_map:: MultiSpan , Span , DUMMY_SP } ;
27
27
use tracing:: debug;
28
28
29
- use std:: cmp;
30
-
31
29
fn lint_levels ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> LintLevelMap {
32
30
let store = unerased_lint_store ( tcx) ;
33
31
let crate_attrs = tcx. hir ( ) . attrs ( CRATE_HIR_ID ) ;
@@ -91,12 +89,6 @@ impl<'s> LintLevelsBuilder<'s> {
91
89
for & ( ref lint_name, level) in & sess. opts . lint_opts {
92
90
store. check_lint_name_cmdline ( sess, & lint_name, level, self . crate_attrs ) ;
93
91
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
-
100
92
let lint_flag_val = Symbol :: intern ( lint_name) ;
101
93
102
94
let ids = match store. find_lints ( & lint_name) {
@@ -105,9 +97,8 @@ impl<'s> LintLevelsBuilder<'s> {
105
97
} ;
106
98
for id in ids {
107
99
// 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 ;
111
102
}
112
103
113
104
self . check_gated_lint ( id, DUMMY_SP ) ;
0 commit comments