rust-lang / rust-lang/rust-clippy

Box<T> where T is small

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.