@@ -2,6 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help;
2
2
use rustc_ast:: ast:: { Crate , Inline , Item , ItemKind , ModKind } ;
3
3
use rustc_errors:: MultiSpan ;
4
4
use rustc_lint:: { EarlyContext , EarlyLintPass , Level , LintContext } ;
5
+ use rustc_middle:: lint:: LevelAndSource ;
5
6
use rustc_session:: impl_lint_pass;
6
7
use rustc_span:: { FileName , Span } ;
7
8
use std:: collections:: BTreeMap ;
@@ -45,11 +46,10 @@ declare_clippy_lint! {
45
46
"file loaded as module multiple times"
46
47
}
47
48
48
- #[ derive( PartialOrd , Ord , PartialEq , Eq ) ]
49
49
struct Modules {
50
50
local_path : PathBuf ,
51
51
spans : Vec < Span > ,
52
- lint_levels : Vec < Level > ,
52
+ lint_levels : Vec < LevelAndSource > ,
53
53
}
54
54
55
55
#[ derive( Default ) ]
@@ -95,11 +95,11 @@ impl EarlyLintPass for DuplicateMod {
95
95
. iter ( )
96
96
. zip ( lint_levels)
97
97
. filter_map ( |( span, lvl) | {
98
- if let Some ( id) = lvl. get_expectation_id ( ) {
98
+ if let Some ( id) = lvl. lint_id {
99
99
cx. fulfill_expectation ( id) ;
100
100
}
101
101
102
- ( !matches ! ( lvl, Level :: Allow | Level :: Expect ( _ ) ) ) . then_some ( * span)
102
+ ( !matches ! ( lvl. level , Level :: Allow | Level :: Expect ) ) . then_some ( * span)
103
103
} )
104
104
. collect ( ) ;
105
105
0 commit comments