rust-lang / rust-lang/rust-analyzer
Request: Selectively disable `rust-analyzer`-internal warnings, similar to `#[allow]` syntax?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I know that I can use "analyzer.diagnostics.disabled" to suppress certain diagnostics globally or per-workspace, but sometimes I would like to suppress them only sometimes, in some modules or in some occurrences. For example, rust-analyzer(incorrect-ident-case) for auto-generated bindings.
I do use
#![allow(
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
)]
which keeps cargo from complaining on build/check. It would be nice to similarly reduce noise in the "Problems" tab, rather than always have a spurious number badge.

Sorry if this has been proposed/dismissed before. I'm sure I'm not the first person to think about this. I did a cursory look, but there's a lot of activity in A-diagnostics 😄
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
The issue does not name files or tests. Start by tracing how rust-analyzer diagnostics and the analyzer.diagnostics.disabled setting are handled, then determine how module- or occurrence-level suppression could interact with Rust's #[allow] syntax and define tests for the expected Problems-tab behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100