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

Useless diagnostics from procmacro expansion

Open SomeoneToIgnore opened this issue 2 years ago • 0 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/editor/src/display_map.rs#L1685 or https://github.com/zed-industries/zed/blob/bde509fa749da60beb4ac378afd3ade15297bb91/crates/multi_buffer/src/multi_buffer.rs#L4764

image

this diagnostic is very volatile, but usually appears around those files, sometimes producing dozens of errors, sometimes a couple. Inside #[gpui::test] macro expansion there's indeed a let mut ... binding that does not need to be mutable, but

  • rustc/cargo does not emit such warnings
  • what the end procmacro user is supposed to do about it?

SomeoneToIgnore avatar Feb 08 '24 20:02 SomeoneToIgnore