rust-lang / rust-lang/rust-clippy
avoid-breaking-exported-api config should default to false for binary crates
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Description
As it stands, the Clippy configuration variable avoid-breaking-exported-api defaults to true for binary crates. This probably doesn't make a lot of sense: binaries don't have an API, and it is not uncommon to have pub symbols in them for various reasons: most notably to temporarily suppress "unused" warnings during development.
I would suggest the default for binary crates should be false.
It is worth considering whether there should be a lint for exported API in binary crates. This would catch some unused code cases, as noted above. Let me know if I should file a separate issue for that.
Version
rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: x86_64-unknown-linux-gnu
release: 1.69.0
LLVM version: 15.0.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
Start by locating Clippy's handling of the avoid-breaking-exported-api configuration and how it determines whether a crate is binary or library. Inspect the existing tests for this configuration and crate type. Done means the default is false for binary crates while the library behavior remains unchanged, with tests covering the distinction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100