rust-lang / rust-lang/rust-clippy

proposed new linter rules

Open
#14,549 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Hi,

I am interested in some new linter rules for clippy:

  • Warn when a runtime or development dependency is configured with a Rust edition prior to the latest stable edition, such as the implicit 2015 edition. This is an SCA/SAST-like policy that encourages crate maintainers to keep up to date with modern security, safety, and performance enhancements. Naturally, with an option to disable the rule. Ideally on by default, though opt-in is also acceptable.
  • Warn when first party code uses unsafe sections. Obviously designed for use with typical brogramming projects not intensive, embedded or std crate development. Should exhibit an option to disable the rule per-crate, as well as an option to disable entirely. Using unsafe everywhere defeats the purpose of using Rust for safe coding. Ideally opt-out, but would also be satisfied with an opt-in parameter, such as a crate configuration option.

Would have posted these in the Rust forum but unfortunately it has broken 100% of my various 2FA options for some reason.

Version
N/A
Additional Labels

No response

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 Clippy's existing lint rules and crate configuration options. Break the proposal into the dependency-edition policy and first-party unsafe-code policy, then determine their expected defaults, opt-out or opt-in behavior, and scope. Done would require an agreed design for both rules, including how exceptions and configuration are handled.

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.