rust-lang / rust-lang/rust-clippy

`search_is_some`: Use a regular visitor instead of `ExprUseVisitor`

Open
#16,086 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

When building the suggestion, the lint is unnecessarily using ExprUseVisitor to handle the closure arg's type change. This works currently, but with rust-lang/rust#138961 this will be broken. Using a regular HIR visitor will fix this and be a better match for what the lint wants to do.

Version

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 at the search_is_some lint and locate where ExprUseVisitor handles the closure argument's type change. Read the surrounding HIR visitor code and the referenced rust-lang/rust#138961 issue before choosing the regular visitor approach. Done means the lint no longer relies on ExprUseVisitor and preserves its suggestion behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.