rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Duplicate `warnings` lint complete

Open A4-Tacks opened this issue 8 months ago • 2 comments

rust-analyzer version: rust-analyzer 0.4.2848-standalone

rustc version: rustc 1.95.0-nightly (a293cc4af 2026-01-30)

editor or extension: Vim

code snippet to reproduce:

#[allow(w$0)]
#[allow(w)]
        warnings                                    f [LS]   mass-change the level for lints which produce
        warnings                                    f [LS]   warnings
        wasm_c_abi                                  f [LS]

A4-Tacks avatar Apr 03 '26 13:04 A4-Tacks

I'll take a look at this — probably just needs deduplication in the lint completion provider.

barry3406 avatar Apr 09 '26 17:04 barry3406

I took a look — the duplication is in the codegen at xtask/src/codegen/lints.rs. DEFAULT_LINTS is built by chaining individual lints and lint groups, and warnings exists in both (rustc -Whelp outputs it as an individual lint and as a lint group). There's already a skip for warnings when writing DEFAULT_LINT_GROUPS (line 361), but the same skip is missing from the loop that writes lint groups into DEFAULT_LINTS (line 354). I can send a fix.

JasmineLCY avatar Apr 15 '26 23:04 JasmineLCY