rust-lang / rust-lang/rust-clippy
actually use substs during const eval
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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