Rust analyzer failed to load workspace error in VScode

I am cloning this repository
And rust-analyzer gives me the following error for cargo.toml

rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /Users/user/bulletproofs-2/Cargo.toml, cargo 1.38.0-nightly (d0f828419 2019-07-23): Failed to run `cargo metadata --manifest-path /Users/user/bulletproofs-2/Cargo.toml` in `/Users/user/bulletproofs-2`: `cargo metadata` exited with an error: error: Found argument '--filter-platform' which wasn't expected, or isn't valid in this context

    cargo metadata --format-version <VERSION> --manifest-path <PATH>

For more information try --help

I've read that one common issue with this is cargo not being in $PATH, but for me cargo works from the terminal. Any suggestions?

Sounds like some sort of version mismatch. Is rust-analyzer expecting cargo to be a newer version?

1 Like

I am not sure, how can I tell this? I'm fairly new to rust

This project has a rust-toolchain file that pins it to a very old nightly snapshot of the Rust toolchain. It might simply be incompatible with modern rust-analyzer.


Thanks! Changed it to nightly-2020-07-10 in my fork, hope it doesn't break anything

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.