
While trying to work on a Rust Project in Visual Studio Code (VSCode) IDE you get the error "rust-analyzer failed to discover workspace" then this could be because of the below few reasons.
Fix/Solution
- Make sure that the Cargo.toml is present in the root folder of your Rust project.

If you moved it somewhere, then make sure to get it back.
If you can't find it then you can run the cargo init in the terminal to generate the file.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!