Skip to content

Commit e75b098

Browse files
committed
Filter prelude glob imports
1 parent afb2e2c commit e75b098

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_lints/src/wildcard_imports.rs

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ impl LateLintPass<'_, '_> for WildcardImports {
7676
if_chain! {
7777
if !in_macro(item.span);
7878
if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind;
79+
// don't lint prelude glob imports
80+
if !use_path.segments.iter().last().map_or(false, |ps| ps.ident.as_str() == "prelude");
7981
let used_imports = cx.tcx.names_imported_by_glob_use(item.hir_id.owner_def_id());
8082
if !used_imports.is_empty(); // Already handled by `unused_imports`
8183
then {

0 commit comments

Comments
 (0)