rust-analyzer
rust-analyzer copied to clipboard
Fails to properly handle a destructuring assignment
In a relatively new version of Rust (it seems 1.59.0), you can use a destructuring assignment which allows you to write code like this:
_ = String::new();
while earlier it was necessary to use let for this:
let _ = String::new();
RA swears at this, although this is the valid code that compiles without any errors.

rust-analyzer version: rust-analyzer version: db2a7087b 2021-12-13 stable
rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)
rust-analyzer you're using is pretty old. Updating it to the latest version should work.