如何将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

原创内容,如需转载,请注明出处;

本文地址: https://www.perfcode.com/p/how-to-update-rust.html

分类: 计算机技术
推荐阅读:
Golang中 unreachable code 提示出现的原因 出现unreachable code提示,是因为有代码无论如何都不会被执行;
Python exec()函数 Python中的exec函数用于动态执行Python代码。它接受一个包含Python代码的字符串作为参数,并将其作为Python程序执行。
SQL删除数据库 如果要删除现有的数据库,则可以使用DROP DATABASE语句;
ValueError: complex() arg is a malformed string解决办法 在Python使用complex()函数对字符串进行转换时,字符串在+或-的周围必须不能有空格。例如complex('1+2j')是合法的,但complex('1 + 2j')会触发ValueError异常。
TypeError: can't take floor or mod of complex number. 在Python中,复数类型不支持地板除(floor division)和取模(modulo)运算。因此,在尝试对复数执行//、%或divmod()函数运算时,会引发TypeError异常,提示can't take floor or mod of complex number.
快速创建HTTP服务来分享文件 在Linux系统下,你可以快速的创建HTTP服务,将指定文件通过HTTP分享出来,而这只需要一条命令: