Filter prelude glob imports
This commit is contained in:
parent
06a6189376
commit
f4f781d5cf
@ -76,6 +76,8 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item<'_>) {
|
||||
if_chain! {
|
||||
if !in_macro(item.span);
|
||||
if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind;
|
||||
// don't lint prelude glob imports
|
||||
if !use_path.segments.iter().last().map_or(false, |ps| ps.ident.as_str() == "prelude");
|
||||
let used_imports = cx.tcx.names_imported_by_glob_use(item.hir_id.owner_def_id());
|
||||
if !used_imports.is_empty(); // Already handled by `unused_imports`
|
||||
then {
|
||||
|
Loading…
Reference in New Issue
Block a user