Skip to content

wildcard_imports triggers for use example::bindgen_prelude::* #10846

Closed
@oold

Description

@oold

Summary

Running Clippy on code that has wildcard imports for prelude modules that aren't named exactly as prelude triggers the wildcard_imports lint.

Lint Name

wildcard_imports

Reproducer

I tried this code:

use napi::{
    bindgen_prelude::*,
};

I saw this happen:

warning: usage of wildcard import
 --> src\a\mod.rs:5:5
  |
5 |     bindgen_prelude::*,
  |     ^^^^^^^^^^^^^^^^^^ help: try: `bindgen_prelude::{FromNapiValue, ToNapiValue}`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports

I expected to see this happen:

No emitted lint warning.

Version

rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: x86_64-pc-windows-msvc
release: 1.69.0
LLVM version: 15.0.7

Additional Labels

@rustbot label +L-pedantic

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveL-pedanticLint: Belongs in the pedantic lint groupgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions