rust-lang / rust-lang/rust-clippy

needless_borrowed_reference is too opinionated

Open
#10,245 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

needless_borrowed_reference, newly enabled by default in 1.67 rejects patterns like &(ref x, ref y) and recommends the "match ergonomics" version instead. I intentionally avoid match ergonomics due to the confusion between values and references it introduces when reading code, and I'm not alone in that. By enabling this lint by default, clippy is forcing an unwanted stylistic change and making my code less readable. I would rather not have to go through every single project allowlisting this to unbreak CI, and I particularly don't want to have to do that repeatedly if more opinionated lints are liable to arise.

Version

No response

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 the linked Clippy documentation for needless_borrowed_reference and the issue's discussion of its default-enabled status. The payload names no source files, tests, or concrete accepted change; done would require a maintainer decision about the lint's default policy and corresponding project updates.

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.