rust-lang / rust-lang/rust-analyzer
Use EarlyPassLints from rustc (and clippy)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Some lints in rustc work via implementing the EarlyPassLint trait. This trait only needs ast level data and not types or hir level data, so it should be easy to port it, I think.
If this kind of lint implementation (each lint provides some functions, for example check_expr, check_block, check_ident, ... function, that RA should call it for each changed expression, block, ...) is ok performance-wise for ide usage (I think a small change leads to small expressions become invalidated, but I'm not sure), reusing them from rustc and clippy would save some effort and bring some consistency between rustc and RA diagnostics. With future unification of RA and rustc, we can think about porting other lints as well.
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
Begin with rustc_lint::passes::EarlyLintPass and its check_expr, check_block, and check_ident entry points, then compare the linked rustc and Clippy implementors with RA’s existing redundant-field-name lint. Before implementation, establish whether this invalidation model is viable for IDE use and select a concrete subset; the issue does not define a target lint, files, tests, or completion criteria.
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