rust-lang / rust-lang/rust-clippy

actually use substs during const eval

Open
#4,422 0 comments 0 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

The field https://github.com/rust-lang/rust-clippy/blob/2cc23a5b18de3726de81202802fc459559342215/clippy_lints/src/consts.rs#L219 is currently dead code (defaults to an empty slice always). We should make it be the current body's identity substs. Not sure if these are available in the LateContext or if we need to fetch them via the identity_substs query

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 in clippy_lints/src/consts.rs at the field around line 219 and trace how constant evaluation receives the current body context. Determine whether the LateContext provides the identity substitutions or whether the identity_substs query is needed. Done means the field uses the current body's identity substitutions instead of always remaining an empty slice.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
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.