rust-lang / rust-lang/rust-analyzer
Default lints should correspond to rustc
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Summary
I would expect that rust-analyzer, with default settings, would report the same lints (warnings, errors, etc.) as rustc
Details
Currently this is not the case; for example I also see messages about these:
inactive-code— this may have a special purpose in some editors? In Kate it's more annoying than useful, but that may be just Kate.remove-unnecessary-else— nearest equivalent is Clippy'sredundant_else?
The default enabled lints also do not correspond to Clippy's default lints (there is a note in the manual about enabling Clippy by default).
Motivation
I would (naively) expect that a project which is clean (reports no lints) under cargo check is also clean under rust-analyzer, and vice-versa. This makes it easier for developers using different tools to collaborate on a project.
Further motivation: the rust-analyzer project should probably not be responsible for choosing which lints are enabled by default (especially when both rustc and clippy already do this).
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 by comparing rust-analyzer's default diagnostics with rustc via cargo check, then review the examples in the issue and Clippy's default lint list. Done means the default rust-analyzer lints consistently match the intended rustc behavior, with a clear decision about how Clippy-related lints are handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100