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

Fails to properly handle a destructuring assignment

Open nanoqsh opened this issue 3 years ago • 1 comments

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. image

rust-analyzer version: rust-analyzer version: db2a7087b 2021-12-13 stable

rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)

nanoqsh avatar Sep 12 '22 02:09 nanoqsh

rust-analyzer you're using is pretty old. Updating it to the latest version should work.

lowr avatar Sep 12 '22 17:09 lowr