Got this error with rust-analyzer VS Code, although cargo build builds the project without errors or warnings.
rustc version: 1.54.0
I would like to stay on the "stable" rustc version and not shift to "nightly".
Update rustc to fix this and ensure that Visual Studio Code uses the correct Rust compiler.
rustup update to update rustcrust-analyzer: Ensure that ctrl+p -> Rust Analyzer: Show RA Version shows rust-analyzer version: 183ef048f 2021-11-22 stable, or later.cargo clean to clear obsoleted compiler outputThis should fix the issue. If not, have a look here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With