iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🐥

rust-analyzer may issue different warnings from rustc

に公開

As you can see by referring to the rust-analyzer source, warning detection is independently implemented (I have not yet investigated whether all warnings are custom implementations or if some use rustc's processing).
While rustc only needs to be able to compile via batch processing, rust-analyzer requires interactive checks, which is likely why they cannot share the same data structures.

The problem this causes is that you might spend an hour or so troubleshooting a mysterious bug where rust-analyzer issues a warning even though cargo build shows nothing. I ran into this myself.

Remembering that "this sort of thing can happen" can be helpful on rare occasions.

Discussion