如何将Rust更新到最新版
Rust每隔一段时间就会有新的版本,若要将已安装的Rust更新到最新版,并不用先卸载旧的版本,只需要使用rustup
工具;
查看Rust版本
rustc -V
rustc 1.54.0 (a178d0322 2021-07-26)
更新Rust
rustup update
看到类似以下信息表示更新完成;
PS C:\Users\hocn> rustup update info: syncing channel updates for 'stable-x86_64-pc-windows-msvc' info: latest update on 2022-04-07, rust version 1.60.0 (7737e0b5c 2022-04-04) info: downloading component 'cargo' 3.9 MiB / 3.9 MiB (100 %) 778.2 KiB/s in 5s ETA: 0s info: downloading component 'clippy' 1.7 MiB / 1.7 MiB (100 %) 516.6 KiB/s in 3s ETA: 0s info: downloading component 'rust-docs' 19.6 MiB / 19.6 MiB (100 %) 459.4 KiB/s in 35s ETA: 0s info: downloading component 'rust-std' 24.0 MiB / 24.0 MiB (100 %) 630.8 KiB/s in 41s ETA: 0s info: downloading component 'rustc' 56.7 MiB / 56.7 MiB (100 %) 742.1 KiB/s in 2m 49s ETA: 0s info: downloading component 'rustfmt' 2.2 MiB / 2.2 MiB (100 %) 630.8 KiB/s in 3s ETA: 0s info: removing previous version of component 'cargo' info: removing previous version of component 'clippy' info: removing previous version of component 'rust-docs' info: removing previous version of component 'rust-std' info: removing previous version of component 'rustc' info: removing previous version of component 'rustfmt' info: installing component 'cargo' info: installing component 'clippy' info: installing component 'rust-docs' 19.6 MiB / 19.6 MiB (100 %) 1.7 MiB/s in 9s ETA: 0s info: installing component 'rust-std' 24.0 MiB / 24.0 MiB (100 %) 8.0 MiB/s in 2s ETA: 0s info: installing component 'rustc' 56.7 MiB / 56.7 MiB (100 %) 9.3 MiB/s in 6s ETA: 0s info: installing component 'rustfmt' info: checking for self-updates stable-x86_64-pc-windows-msvc updated - rustc 1.60.0 (7737e0b5c 2022-04-04) (from rustc 1.54.0 (a178d0322 2021-07-26)) info: cleaning up downloads & tmp directories