Allow `dead_code` lint to be configured to validate that all pub code is used within the workspace
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
When this setting is true, dead_code would analyze an entire workspace, checking that all code is used somewhere in the workspace.
This is particularly useful in projects that have libraries (for compilation speed or modularity reasons) that are never intended to be published. In those cases, it's easy to accidentally forget to remove dead code, as pub library types and traits and functions and constants are exempted.
With the addition of workspace-level lint controls, this feels like it may actually be possible. #74970 is related, but only targets binary crates.
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 reading the existing dead_code lint and the workspace-level lint controls mentioned in the issue, then review related issue #74970. Determine the design needed to validate use of public code across a workspace, including libraries, and define tests that distinguish used from unused public items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100