Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具

走进 Rust:Windows 环境搭建

Rust Windows 镜像 大约 5288 字


  • CARGO_HOME:设置Cargo目录为D:\rust\cargo
  • RUSTUP_HOME:设置Rustup目录为D:\rust\rustup

配置 Cargo 镜像


registry = ""
replace-with = 'ustc'
registry = "git://"
check-config = false

添加http.check-config = false为了解决设置代理后无法下载的问题。报错信息如下:

Caused by:
    [35] SSL connect error (schannel: next InitializeSecurityContext failed: Unknown error (0x80092013)


安装 Rust

下载 rustup




但是如果主要用于GNU ABI,则可以不用安装。(微软的Visual太大了,不想安装)。


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

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":

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)




  • GNU ABI (using GCC)
    • i686-pc-windows-gnu:32位GNU
    • x86_64-pc-windows-gnu64GNU
  • The MSVC ABI
    • i686-pc-windows-msvc:32位微软Visual C++
    • x86_64-pc-windows-msvc:64位微软Visual C++
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:


This can be modified with the CARGO_HOME environment variable.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:


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

I'm going to ask you the value of each of these installation options.
You may simply press the Enter key to leave unchanged.

Default host triple? 输入`x86_64-pc-windows-gnu`。

Default toolchain? (stable/beta/nightly/none) 输入`stable`。

Profile (which tools and data to install)? (minimal/default/complete) 输入`default`。

Modify PATH variable? (y/n) 输入`y`。




info: profile set to 'default'
info: setting default host triple to x86_64-pc-windows-gnu
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
463.3 KiB / 463.3 KiB (100 %) 402.6 KiB/s in  1s ETA:  0s
info: latest update on 2020-04-23, rust version 1.43.0 (4fb7144ed 2020-04-20)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-mingw'
info: downloading component 'rust-std'
info: downloading component 'rustc'
 54.1 MiB /  54.1 MiB (100 %)  44.6 MiB/s in  1s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 12.1 MiB /  12.1 MiB (100 %)   1.2 MiB/s in  8s ETA:  0s
info: installing component 'rust-mingw'
info: installing component 'rust-std'
 15.8 MiB /  15.8 MiB (100 %)  11.8 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 54.1 MiB /  54.1 MiB (100 %)   8.6 MiB/s in  6s ETA:  0s
  7 IO-ops /   7 IO-ops (100 %)   6 IOPS in  2s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable'

  stable installed - rustc 1.43.0 (4fb7144ed 2020-04-20)

Rust is installed now. Great!

To get started you need Cargo's bin directory (D:\rust\cargo\bin) in your PATH
environment variable. Future applications will automatically have the
correct environment, but you may need to restart your current shell.

Press the Enter key to continue.





rustup component add rust-src


info: downloading component 'rust-src'
  1.6 MiB /   1.6 MiB (100 %) 127.5 KiB/s in 16s ETA:  0s
info: installing component 'rust-src'


阅读 6096 · 发布于 2020-06-27

————        END        ————

Give me a Star, Thanks:)


随便看看 换一批