rust-lang / rust-lang/rust-clippy

Lint suggestion: &mut parameter never read

Open
#3,761 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This is a new lint suggestion - which I don't know if is possible - based on ADA's in_out parameter property.

In a function, catch any &mut parameter which is never read, suggesting to move it as/into the return type.

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 proposes a new Clippy lint for &mut parameters that are never read, based on Ada's in_out parameter property. Start by reviewing existing Clippy lint implementations and their tests; done means the lint reliably identifies the described parameters and suggests moving them into the return type.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.