rust-lang / rust-lang/rust-clippy
Box<T> where T is small
Open
Nobody has claimed this yet.
A-lint
E-medium
L-perf
T-middle
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Where:
- Small means "three words or fewer" (a la Vec)
- Box is not required for monomorphization
- T is not actually a generic (that is, your code doesn't have to work with potentially differently sized Ts).
Note that HashMap is five words by default, so it actually shouldn't qualify for this lint (IMO) but it would subsume the Vec lint.
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 reviewing the existing Vec lint and the project’s lint test conventions. Compare the stated rules for Box, including the three-word limit, monomorphization requirement, and exclusion of differently sized generic types; confirm whether HashMap should be excluded. Done means the behavior and boundary cases are covered by lint tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100