Rust-analyzer doesn't work with FetchWorkspaceError (os error 5)

296 views Asked by At

I just start to learn rust. I already install rust and cargo on my laptop

PS C:\Users\USER> rustc --version
rustc 1.73.0 (cc66ad468 2023-10-03)
PS C:\Users\USER> rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.73.0 (cc66ad468 2023-10-03)`
PS C:\Users\USER> cargo --version
cargo 1.73.0 (9c4383fb5 2023-08-26)

I want to code rust on vscode, but my rust-analyzer doesn't work. It reports this error

[ERROR rust_analyzer::main_loop] FetchWorkspaceError:
rust-analyzer failed to load workspace: Failed to load the project at C:\Users\USER\muic\iccs311\lecture\Cargo.toml: Failed to query rust toolchain version at C:\Users\USER\muic\iccs311\lecture, is your toolchain setup correctly?: "C:\\Users\\USER\\.cargo\\bin" "--version" failed: Access is denied. (os error 5)

I don't know why access is denied

I also open the entire directory, inside my directory already contain Cargo.toml

files structure

error picture

0

There are 0 answers