rust-lang / rust-lang/rust-clippy

unused_rust_features lint

Open
#8,328 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lint
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

What it does

(I am not sure if this is the right place to put this, perhaps it's better as a rustc warning).

I'd like a warning that tells me when on Nightly one (ore more than one) Rust feature isn't used.

Lint Name

unused_rust_features

Category

pedantic

Advantage

Cleaner and shorter code, less future churn, less complexity to expect in the code.

Drawbacks

It's pedantic because it doesn't make the code safer or faster. It could cause a bit more work right now to clean unused feature annotations. While writing code it could cause to comment out features temporarily and uncomment them out later if a feature is used again. But overall I prefer my Rust code to be cleaner.

Example
#![feature(array_chunks, box_syntax)]
fn main() {}

Currently this code gives no warnings. Both features could be removed.

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

The issue names no implementation files, tests, or entry points. Start by locating how rust-clippy defines lints and how Rust feature declarations are exposed to lint code; done should include a warning for unused nightly features in the provided example and coverage for the relevant cases.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.