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

rust-analyzer doesn't show some errors from cargo check

Open CyriacBr opened this issue 3 years ago • 7 comments

rust-analyzer version: 0.4.1196

rustc version: rustc 1.60.0 (7737e0b5c 2022-04-04)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME).

  • RUSTUP_HOME: /usr/local/rustup.
  • CARGO_HOME: /usr/local/cargo

Basically, my code has errors that rust-analyzer doesn't pick up. This doesn't happen for all errors. It all started one or two versions back.

  • Errors from rust check:
    image.
  • No error on my IDE on the same line: image

Sadly, this is a private project so I can't really share the repo. I'm unsure how to proceed to get help. I tried to make a repro but it's hard because only some errors are not shown.
If that counts, I use cargo workspace, and from searching, seems rust-analyzer has trouble with that sometimes.

Again sorry that I can't provide a reproduction, but maybe off the bat there's something I can do?

CyriacBr avatar Sep 07 '22 19:09 CyriacBr

Does cargo cleaning the project fix it? Sometimes cargo gets confused by r-a that messes with cargo checks that r-a executes.

Veykril avatar Sep 07 '22 20:09 Veykril

Nope, it did not fix it. Restarting RA didn't help either.
Also, unsure if it's related, but it seems like it's a lifetime error that completely disable any other errors from being reported. It happened in the past too. As soon as I solve the lifetime error, RA correctly report errors in other parts of the code.

If this is important, this is what the lifetime error looks like:
image

CyriacBr avatar Sep 07 '22 20:09 CyriacBr

Are we sending empty diagnostics again?

lnicola avatar Sep 07 '22 20:09 lnicola

Are we sending empty diagnostics again?

How can I debug things how my side?

CyriacBr avatar Sep 08 '22 11:09 CyriacBr

Can you check the Log (Extension Host) logs for any exceptions being thrown? Also please check the Rust Analyzer Server Log logs for anything that might be releveant. You can access these via the Output tab in VSCode

Veykril avatar Sep 08 '22 11:09 Veykril

Output for Rust Analyzer Server and Rust Analyzer Server Trace are empty. As for the extension host, there is no error:
image

CyriacBr avatar Sep 09 '22 13:09 CyriacBr

@CyriacBr I suppose you should put the RA server logging to verbose in the settings

image

ulugbekna avatar Sep 12 '22 12:09 ulugbekna

are you still experiencing this?

Veykril avatar Feb 13 '23 15:02 Veykril

I have got the same issue now. Inline type hints are shown, but errors / warnings are not. But there are definitely cargo check problems reported

avkonst avatar May 02 '24 18:05 avkonst