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

redundant_pub_crate conflicts with pub use mod::* #13676

Open
erenon opened this issue Nov 11, 2024 · 0 comments
Open

redundant_pub_crate conflicts with pub use mod::* #13676

erenon opened this issue Nov 11, 2024 · 0 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@erenon
Copy link

erenon commented Nov 11, 2024

Summary

Given this module:

mod foo;

pub use foo::*;

and the source file foo.rs:

pub(crate) fn bar() {}
pub fn baz() {}
pub fn qux() {}

After redundant_pub_crate is applied, pub(crate) fn bar becomes pub fn bar(), and because of the pub use foo::*, it becomes part of the public API, whereas previously it was crate private.

Lint Name

redundant_pub_crate

Reproducer

No response

Version

rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: aarch64-apple-darwin
release: 1.81.0
LLVM version: 18.1.7

Additional Labels

No response

@erenon erenon added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

No branches or pull requests

1 participant