官網下載安裝文件
安裝mignw
修改系統環境變量
名稱 - 值
RUSTUP_DIST_SERVER : https://mirrors.ustc.edu.cn/rust-static
RUSTUP_UPDATE_ROOT : https://mirrors.ustc.edu.cn/rust-static/rustup
運行 init
提示沒有安裝編譯工具
選擇繼續
選擇2自定義
default host triple
x86_64-pc-windows-gnu
default toolchain
stable
modify PATH variable
yes
選擇1進行安裝
等待下載完成
.cargo/bin會自動添加到系統環境變量path中
手動把mignw的路徑也添加到系統環境變量path中
測試
rustup --version
rustup update
rustup show
F:\>cargo new hello
Created binary (application) `hello` package
F:\>cd hello
F:\hello>cargo run
Compiling hello v0.1.0 (F:\hello)
Finished dev [unoptimized + debuginfo] target(s) in 2.69s
Running `target\debug\hello.exe`
Hello, world!