下载rust
到rust官网下载
运行以后提示需要安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | Rust Visual C++ prerequisites Rust requires the Microsoft C++ build tools for Visual Studio 2013 or later, but they don't seem to be installed. The easiest way to acquire the build tools is by installing Microsoft Visual C++ Build Tools 2019 which provides just the Visual C++ build tools: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019 Please ensure the Windows 10 SDK and the English language pack components are included when installing the Visual C++ Build Tools. Alternately, you can install Visual Studio 2019, Visual Studio 2017, Visual Studio 2015, or Visual Studio 2013 and during install select the "C++ tools": https://visualstudio.microsoft.com/downloads/ Install the C++ build tools before proceeding. If you will be targeting the GNU ABI or otherwise know what you are doing then it is fine to continue installation without the build tools, but otherwise, install the C++ build tools before proceeding. Continue? (Y/n) |
这里选择否退出。
安装Visual c++ 生成工具
, 去提示的地址
在
安装时在
安装完之后重启。
安装rust
重新打开
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | Welcome to Rust! This will download and install the official compiler for the Rust programming language, and its package manager, Cargo. It will add the cargo, rustc, rustup and other commands to Cargo's bin directory, located at: C:\Users\windows\.cargo\bin This can be modified with the CARGO_HOME environment variable. Rustup metadata and toolchains will be installed into the Rustup home directory, located at: C:\Users\windows\.rustup This can be modified with the RUSTUP_HOME environment variable. This path will then be added to your PATH environment variable by modifying the HKEY_CURRENT_USER/Environment/PATH registry key. You can uninstall at any time with rustup self uninstall and these changes will be reverted. Current installation options: default host triple: x86_64-pc-windows-msvc default toolchain: stable profile: default modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation |
这里选择第一个, 或者直接按回车, 出现安装成功提示:
1 2 3 4 5 6 | Rust is installed now. Great! To get started you need Cargo's bin directory (%USERPROFILE%.cargo\bin) in your PATH environment variable. Future applications will automatically have the correct environment, but you may need to restart your current shell. |
测试rust是否成功安装
打开cmd并输入:
1 | rustc --version |
你应能看到已发布的最新稳定版的版本号、提交哈希和提交日期, 类似如下格式:
1 | rustc 1.43.0 (4fb7144ed 2020-04-20) |
安装程序也自带一份文档的本地拷贝,可以离线阅读。运行 rustup doc 在浏览器中查看本地文档。
参考文章:
Rust程序设计语言简体中文版-安装