@@ -2,6 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help;
22use rustc_ast:: ast:: { Crate , Inline , Item , ItemKind , ModKind } ;
33use rustc_errors:: MultiSpan ;
44use rustc_lint:: { EarlyContext , EarlyLintPass , Level , LintContext } ;
5+ use rustc_middle:: lint:: LevelAndSource ;
56use rustc_session:: impl_lint_pass;
67use rustc_span:: { FileName , Span } ;
78use std:: collections:: BTreeMap ;
@@ -45,11 +46,10 @@ declare_clippy_lint! {
4546 "file loaded as module multiple times"
4647}
4748
48- #[ derive( PartialOrd , Ord , PartialEq , Eq ) ]
4949struct Modules {
5050 local_path : PathBuf ,
5151 spans : Vec < Span > ,
52- lint_levels : Vec < Level > ,
52+ lint_levels : Vec < LevelAndSource > ,
5353}
5454
5555#[ derive( Default ) ]
@@ -95,11 +95,11 @@ impl EarlyLintPass for DuplicateMod {
9595 . iter ( )
9696 . zip ( lint_levels)
9797 . filter_map ( |( span, lvl) | {
98- if let Some ( id) = lvl. get_expectation_id ( ) {
98+ if let Some ( id) = lvl. lint_id {
9999 cx. fulfill_expectation ( id) ;
100100 }
101101
102- ( !matches ! ( lvl, Level :: Allow | Level :: Expect ( _ ) ) ) . then_some ( * span)
102+ ( !matches ! ( lvl. level , Level :: Allow | Level :: Expect ) ) . then_some ( * span)
103103 } )
104104 . collect ( ) ;
105105
0 commit comments