rust-lang / rust-lang/rust-clippy
redundant_pub_crate conflicts with pub use mod::*
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the shown foo.rs module and pub use foo::* reproducer, then locate the redundant_pub_crate lint implementation and its tests in the Clippy source. Verify that applying the lint does not expose bar through the glob re-export; add a regression test covering the original and transformed visibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100