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

False-positive diagnostics in regular code of a large codebase

Open SomeoneToIgnore opened this issue 1 year ago • 2 comments

rust-analyzer version: rust-analyzer version: 0.4.1834-standalone (c48f14553 2024-02-07) rustc version: rustc 1.75.0 (82e1608df 2023-12-21)

Open Zed, wait for r-a to load it and produce diagnostics in this file: https://github.com/zed-industries/zed/blob/bde509fa749da60beb4ac378afd3ade15297bb91/crates/project/src/project.rs#L580

Expected: zero warnings/errors, same as cargo check --workspace --all-targets outputs Actual: node and fs are labeled as "unused variables" but are used a few lines below, 2 more "errors" are also false-positive

image

SomeoneToIgnore avatar Feb 08 '24 19:02 SomeoneToIgnore

There's a lot of those around, e.g. image

SomeoneToIgnore avatar Feb 08 '24 19:02 SomeoneToIgnore

I'm also seeing this - unused variable warnings on struct members that are used (removing them causes a compile error)

Edgeworth avatar Feb 26 '24 10:02 Edgeworth