Skip to content

[experiment] move needless_borrows_for_generic_args to nursery - #162914

Open
CommanderStorm wants to merge 1 commit into
rust-lang:mainfrom
CommanderStorm:needless_borrows_for_generic_args-nursery
Open

CommanderStorm wants to merge 1 commit into
rust-lang:mainfrom
CommanderStorm:needless_borrows_for_generic_args-nursery

Conversation

@CommanderStorm

@CommanderStorm CommanderStorm commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

👋
I would like to request an experiment to know if this is a bug in more lints and need disabling.

Beta releases in 13 days as stable and I think the window for backports is passed (?) at least the usual clippy sync, so it would be very helpfull to have this data (I think, not quite sure what is the process exactly).

Concretely, I think the following experiment (which I pieced together from the docs) would be what I would like.
I am not sure about +rustflags vs +cargoflags since those are not super well documented or at least their interaction is a bit unclear.

@craterbot run start=beta end=4b88e00b78888b3c0ce9cae1b10376b3ddfedb6b mode=clippy crates=top-10000 +rustflags=-Znext-solver=coherence

The issue with clippys lintcheck infra is mostly that it was never meant for more than a quick spotcheck, so is incredibly slow, at least on my laptop.
Also the way to triage them is incredibly labor intensive for lintcheck, so not really feasible.

The signal that I am searching for is if there are more crates that

  • stack overflow on this PRs commit
  • already did so on beta stack overflow

Then there would need to be no backport on more lints.

IF interested why moving needless_borrows_for_generic_args to nursery

The issue with clippy seems to be a bit of an weird interaction with const-traits (f.ex. Drop on Vec) messing with some of our lints that were not build for this, but it is hard to narrow down.
needless_borrows_for_generic_args for example is this code that triggers it:

pub enum Value {
    Array(Vec<Value>),
    Null,
}

pub fn repro(value: Option<Value>) -> Option<Value> {
    let predicate = |_: &Value| true;
    value.filter(&predicate)
}

@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. labels Sep 17, 2026
@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu
  • Random selection from Mark-Simulacrum, jieyouxu

@jieyouxu

Copy link
Copy Markdown
Member

Small set:
@craterbot run mode=clippy crates=top-10000 start=beta end="4b88e00b78888b3c0ce9cae1b10376b3ddfedb6b+rustflags=-Znext-solver=coherence Dclippy::needless_borrows_for_generic_args" p=5

@craterbot

Copy link
Copy Markdown
Collaborator

👌 Experiment pr-162914 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-crater Status: Waiting on a crater run to be completed. T-clippy Relevant to the Clippy team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants