(Only records must be content, future perfect!)
1. rust installation and environment variables:
To advance to the following two environment variables configured, so in order to specify the installation path. Otherwise it will be installed by default under the C drive.
CARGO_HOME:D:\Program Files\RUST\.cargo
RUSTUP_HOME:D:\Program Files\RUST\.rustup
Then, this: https://www.rust-lang.org/zh-CN/learn/get-started interface download rustup-init.exe. Click on to perform after the download is complete, there will be a CMD window: read the contents of the above, if not installed Microsoft 2019 builder tools, to open a URL on the screen to download and install.
Then, the input 2 below, a custom installation:
After set up according to their own requirements to start installing it!
Execute the following command to see if the installation was successful:
rustc --version
cargo --version
Run the following commands installation tool chain: other versions can be selected (e.g., nightly-i686-pc-windows-msvc)
rustup toolchain install nightly-x86_64-pc-windows-gnu
Installation Source:
rustup component add rust-src --toolchain nightly
To set the following environment variables have been completed:
RUST: D: \ Program Files \ RUST \ .rustup \ toolchains \ Nightly-i686-PC-Windows-MSVC RUST_SRC_PATH: RUST%% \ lib \ rustlib \ src \ Rust \ src RUSTBINPATH:% CARGO_PATH% \ bin Here are two HKUST source configured to use: RUSTUP_DIST_SERVER: HTTPS: //mirrors.ustc.edu.cn/rust-static RUSTUP_UPDATE_ROOT: HTTPS: //mirrors.ustc.edu.cn/rust-static/rustup and add the following in the path path: % CARGO_HOME% \ bin
Continue the installation:
cargo +nightly install racer // 安装 racer
rustup component add rls-preview --toolchain nightly
rustup component add rust-analysis --toolchain nightly
2. vscode configuration information:
- Download Plugin: search plug rust on vscode, then the first two to install the rankings, then you can also put rustfmt and on vscode-rust-syntax equipment, namely the role of code formatting and syntax highlighting. . .
- Find setings.json file under File / Preferences / settings /, add the following to which:
"rust.mode": "rls",
"rust.cargoHomePath": "%CARGO_HOME%",
"rust.cargoPath":"%RUSTBINPATH%\\cargo.exe",
"rust.racerPath":"%RUSTBINPATH%\\racer.exe",
"rust.rls":"%RUSTBINPATH%\\rls.exe",
"rust.rustfmtPath":"%RUSTBINPATH%\\rustfmt.exe",
"rust.rustup":"%RUSTBINPATH%\\rustup.exe",
"rust.rustLangSrcPath": "%RUST_SRC_PATH%",
"rust.executeCargoCommandInTerminal": true,