cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Lint for negative feature names

Open epage opened this issue 7 months ago • 0 comments

What it does

Checks for negative feature names with prefix no- or not-

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

Advantage

Features are supposed to be additive, and negatively-named features violate it.

Drawbacks

No response

Example

[features]
default = []
no-abc = []
not-def = []

Could be written as:

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

epage avatar May 22 '25 16:05 epage