Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wildcard_imports is ignored in pub uses #13660

Open
Nemo157 opened this issue Nov 6, 2024 · 3 comments · May be fixed by #14182
Open

wildcard_imports is ignored in pub uses #13660

Nemo157 opened this issue Nov 6, 2024 · 3 comments · May be fixed by #14182

Comments

@Nemo157
Copy link
Member

Nemo157 commented Nov 6, 2024

#![deny(clippy::wildcard_imports)]

mod foo {
    #[derive(Debug)]
    pub struct Foo;
}

pub use foo::*;

fn main() {
    println!("{Foo:?}");
}

shows no errors, with and without warn-on-all-wildcard-imports = true.

@samueltardieu
Copy link
Contributor

I think this is on purpose. pub use reexports symbols, so it makes sense to use wildcards there.

@Nemo157
Copy link
Member Author

Nemo157 commented Nov 7, 2024

Some people may want to allow this, I don't and would really like a version of the lint which triggers on it too. (Also it's undocumented that the lint ignores these).

@Centri3
Copy link
Member

Centri3 commented Nov 7, 2024

I am personally fine with this being considered an exception that is linted with warn-on-all-wildcard-imports

@samueltardieu samueltardieu linked a pull request Feb 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants