vscode中rust-analyzer报错解决

1,064 阅读1分钟

image.png

 Failed to find sysroot for Cargo.toml file 
 # rust-analyzer failed to load workspace failed to find sysroot for cargo.toml file
 # Failed to spawn one or more proc-macro servers
 ....
 

直接安装rustrover。然后会提示安装下载rust的标准库

image.png 找到路径的位置

配置vscode

image.png 其中{cargo.sysroot}即为“xxxapple-darwin” 将后面的路径替换为配置对应的路径即可。