@@ -5,14 +5,14 @@ use crate::utils::{
5
5
in_macro, last_line_of_span, match_def_path, opt_def_id, paths, snippet_opt, span_lint, span_lint_and_then,
6
6
without_block_comments,
7
7
} ;
8
- use rustc:: hir:: * ;
9
- use rustc:: lint:: { LateContext , LateLintPass , LintArray , LintPass } ;
10
- use rustc:: { declare_tool_lint, lint_array} ;
8
+ use crate :: rustc:: hir:: * ;
9
+ use crate :: rustc:: lint:: { LateContext , LateLintPass , LintArray , LintPass } ;
10
+ use crate :: rustc:: { declare_tool_lint, lint_array} ;
11
11
use if_chain:: if_chain;
12
- use rustc:: ty:: { self , TyCtxt } ;
12
+ use crate :: rustc:: ty:: { self , TyCtxt } ;
13
13
use semver:: Version ;
14
- use syntax:: ast:: { AttrStyle , Attribute , Lit , LitKind , MetaItemKind , NestedMetaItem , NestedMetaItemKind } ;
15
- use syntax:: source_map:: Span ;
14
+ use crate :: syntax:: ast:: { AttrStyle , Attribute , Lit , LitKind , MetaItemKind , NestedMetaItem , NestedMetaItemKind } ;
15
+ use crate :: syntax:: source_map:: Span ;
16
16
17
17
/// **What it does:** Checks for items annotated with `#[inline(always)]`,
18
18
/// unless the annotated function is empty or simply panics.
@@ -180,10 +180,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
180
180
|| is_word ( lint, "deprecated" ) {
181
181
return
182
182
} ,
183
- ItemKind :: ExternCrate ( ..) => if is_word ( lint, "unused_imports" )
184
- && skip_unused_imports {
183
+ ItemKind :: ExternCrate ( ..) => {
184
+ if is_word ( lint, "unused_imports" )
185
+ && skip_unused_imports {
186
+ return
187
+ }
188
+ if is_word ( lint, "unused_extern_crates" ) {
185
189
return
186
- } ,
190
+ }
191
+ }
187
192
_ => { } ,
188
193
}
189
194
}
0 commit comments