rust-lang / rust-lang/cargo

Lint for redundant feature names

Open
#15,580 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-new-lint S-needs-design
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

What it does

Checks for feature names with prefix use-, with- or suffix -support

See also https://rust-lang.github.io/rust-clippy/master/index.html?groups=cargo#/redundant_feature_names?groups=cargo

Advantage

These prefixes and suffixes have no significant meaning.

Drawbacks

No response

Example
[features]
default = ["use-abc", "with-def", "ghi-support"]
use-abc = []  // redundant
with-def = []   // redundant
ghi-support = []   // redundant

Could be written as:

[features]
default = ["abc", "def", "ghi"]
abc = []
def = []
ghi = []

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 with the linked Clippy redundant_feature_names reference and the TOML examples in this issue to understand the expected cases. No Cargo file or test is named; done means the lint identifies feature names with the listed prefixes or suffix and leaves other feature names unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.