設置環境變量
系統屬性 > 環境變量 > 新建
RUSTUP_HOME=d:\snap\rust\rustup
CARGO_HOME=d:\snap\rust\cargo
下載程序
https://www.rust-lang.org/zh-CN/learn/get-started
安裝程序
需要提前安裝好GCC
并根據提示安裝Rust
程序
rustup-init.exe
選擇
Y
> 選擇2) Customize installation
> 輸入x86_64-pc-windows-gnu
> 多次回車后返回安裝界面 > 選擇1) Proceed with installation (default)
Current installation options:
default host triple: x86_64-pc-windows-gnu
default toolchain: stable
profile: default
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
卸載程序
rustup self uninstall
鏡像加速
更新版本(rustup)
系統屬性 > 環境變量 > 新建
RUSTUP_DIST_SERVER=https://rsproxy.cn
RUSTUP_UPDATE_ROOT=https://rsproxy.cn/rustup
社區第三方庫(crates)
d:\snap\rust\cargo\config
[source.crates-io]
# To use sparse index, change 'rsproxy' to 'rsproxy-sparse'
replace-with = 'rsproxy'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true