Rust安装配置
Rust安装配置
话说前面: 如果你 之前安装过老版本的 rust 请先卸载 我说的是以 msi 文件安装的那种, 请进控制面板–> 程序中进行卸载 
首先 下载官网 的 rustup-init.exe 当前版本是 1.18.0 
然后下载完 然后点击 rusupt-init.exe 
奇迹发生了:  
选 2 进行自定义安装 会一步一步问你 第一个问你是否用 default host tripe 我选的是 
第二个会问你 用哪个版本 我输入 stable 
第三个会问你是否 默认修改环境变量 (这个无所谓了可以后期改) 我选是 
然后就会安装…
安装完成后你会发现在 c 盘–> 用户—->(你的登陆名下) 会多出两个文件夹. rustup 文件夹和. cargo 文件夹 
如果你不想将这两个文件夹放置在 c 盘下那么就把它们剪切到别的盘符下我是移动到了别的盘符了, 单单移动是不行的 
那么你还得 修改环境变量:
CARGO_HOME = "%USERPROFILE%\.cargo"
RUSTUP_HOME = "%USERPROFILE%\.rustup"
接着添加中科大 rust 源: 
在. cargo 文件夹根目录下创建一个 config 文件 没有任何文件后缀, 内容为:
[registry]
index = "https://mirrors.ustc.edu.cn/crates.io-index/"
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index/"下载安装镜像时,你只需要把
https://static.rust-lang.org换成 https://mirrors.ustc.edu.cn/rust-static 即可!
接着再添加环境变量:
RUSTUP_DIST_SERVER = "http://mirrors.ustc.edu.cn/rust-static"
RUSTUP_UPDATE_ROOT = "http://mirrors.ustc.edu.cn/rust-static/rustup"将 cargo 加入 path 环境变量:
%CARGO_HOME%\bin前期工作就可以了 那么打开 cmd 输入 
检查 rustup 有无安装成功
rustup -Vcargo -V检查 cargo 安装 
如果 提示没有默认的 toolchain 那么 install:
rustup install stable-x86_64-pc-windows-msvc
将 msvc 版设为 default
rustup default stable-x86_64-pc-windows-msvc如果设置成功 那么 console 会打印出正确的版本号 
安装插件: 
安装 rustfmt: 
首先 cmd 输入:
rustup show查看 当前 toolchain, 初次安装应该只有 stable-msvc 
那么进行安装 stable-gnu
rustup install stable-x86_64-pc-windows-gnu
rustup install nightly-x86_64-pc-windows-msvc
rustup install nightly-x86_64-pc-windows-gnu安装 rls-preview rust-analysis rust-src:
参考 https://github.com/rust-lang-nursery/rls
Note (nightly only)
Sometimes the rls-preview component is not included in a nightly build due to certain issues. To see if the component is included in a particular build and what to do if it's not, check #641.
rustup component add rls-preview rust-analysis rust-src --toolchain stable-x86_64-pc-windows-msvc
rustup component add rls-preview rust-analysis rust-src --toolchain stable-x86_64-pc-windows-gnu
rustup component add rust-analysis rust-src --toolchain nightly-x86_64-pc-windows-msvc
rustup component add rust-analysis rust-src --toolchain nightly-x86_64-pc-windows-gnu安装 cargo-release:
cargo +stable-x86_64-pc-windows-msvc install cargo-release安装 cargo-check:
cargo +stable-x86_64-pc-windows-msvc install cargo-check安装 rustfmt:
cargo +stable-x86_64-pc-windows-msvc install rustfmt安装 rustsym:
cargo +stable-x86_64-pc-windows-msvc install rustsym安装 racer:
cargo +stable-x86_64-pc-windows-msvc install racer设置 rust_src_path 环境变量(此环境变量不应该写死,在Linux中可以采用灵活的方式确定该变量值)
RUST_SRC_PATH = "%USERPROFILE%\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src"参考 https://github.com/racer-rust/racer
Fetch the Rust sourcecode
automatically via rustup and run rustup component add rust-src in order to install the source to $(rustc --print sysroot)/lib/rustlib/src/rust/src. Rustup will keep the sources in sync with the toolchain if you run rustup update.
manually from git, or download from https://www.rust-lang.org/install.html (the 'rustc' source download behind the 'source' link is the right one).
Set the RUST_SRC_PATH environment variable to point to the 'src' dir in the Rust source installation
(e.g. % export RUST_SRC_PATH=/usr/local/src/rust/src or % export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src" )
Test on the command line:
racer complete std::io::B (should show some completions)
rust-learning
Chinese
- Translation of the official The Rust Programming Language book
- Translation of the Rust By Example
- RustPrimer
- Chinese Rust Community
- The book in Traditional Chinese
- Translation of The Little Book of Rust Macros
Rust安装配置的更多相关文章
- 不用rustup,Windows下gnu版Rust安装与开发环境配置
		写在前面 本文介绍了在不使用rustup的情况下,在Windows上安装gnu版的Rust,并配置开发环境(VSCode + rust-analyzer,CLion + IntelliJ Rust)的 ... 
- Rust 初始配置
		学习 Rust 初始配置 运行环境:Window7 64bit,Rust nightly 1.23; 作者:乌龙哈里 2017-10-15 参考: Rust 中文教程 Rust 官方网站 Rust G ... 
- 1.1 Rust安装
		从今天起,坚持每天学习10分钟Rust...这是一个刚兴起几年的语言,希望深入地进行学习,为什么呢,因为以下这些让人辛酸的理由..... 最开始学习的是C++,没学太懂,之后又学了C,这时还完全对计算 ... 
- windows下 Rust 环境配置
		搭建 Visual Studio Code 开发环境 首先,需要安装最新版的 Rust 编译工具和 Visual Studio Code. Rust 编译工具:https://www.rust-lan ... 
- Hive安装配置指北(含Hive Metastore详解)
		个人主页: http://www.linbingdong.com 本文介绍Hive安装配置的整个过程,包括MySQL.Hive及Metastore的安装配置,并分析了Metastore三种配置方式的区 ... 
- Hive on Spark安装配置详解(都是坑啊)
		个人主页:http://www.linbingdong.com 简书地址:http://www.jianshu.com/p/a7f75b868568 简介 本文主要记录如何安装配置Hive on Sp ... 
- ADFS3.0与SharePoint2013安装配置(原创)
		现在越来越多的企业使用ADFS作为单点登录,我希望今天的内容能帮助大家了解如何配置ADFS和SharePoint 2013.安装配置SharePoint2013这块就不做具体描述了,今天主要讲一下怎么 ... 
- Hadoop的学习--安装配置与使用
		安装配置 系统:Ubuntu14.04 java:1.7.0_75 相关资料 官网 下载地址 官网文档 安装 我们需要关闭掉防火墙,命令如下: sudo ufw disable 下载2.6.5的版本, ... 
- redis的安装配置
		主要讲下redis的安装配置,以及以服务的方式启动redis 1.下载最新版本的redis-3.0.7 到http://redis.io/download中下载最新版的redis-3.0.7 下载后 ... 
随机推荐
- XML DTD约束 对xml文件的crud的查询Read Retrieve操作 xml递归遍历
			本地的dtd文档 xml中引入dtd文档 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE 书 ... 
- maven入门2
			1.修改maven本地仓库位置 没有效果,在新建项目时还是转跳到默认配置 在默认仓库位置添加修改后的setting文件,失败 修改成功,原因是前面修改的是setting而我们需要修改的是default ... 
- 使用c++控制sqlite3
			首先,到官网下载相关的压缩包 https://www.sqlite.org/download.html 但是要自己再重新编译一个, 博主自己收集了一下,密码:hixo https://pan.baid ... 
- Python学习之登陆认证
			需求: 让用户输入用户名密码 认证成功后显示欢迎信息 输错三次后退出程序 可以支持多个用户登录 (提示,通过列表存多个账户信息) 用户3次认证失败后,退出程序,再次启动程序尝试登录时,还是锁定状态(提 ... 
- linux系统批量创建用户和生成8位随机密码
			1.1 脚本案例 批量创建20个用户,用户名为user1-user20,并生成8位随机登录密码,用户组采用键盘输入的方式,并将用户名及登录密码保存到/tmp/create_user.txt普通文 ... 
- php jsonp实例 mip无限滚动组件接口注意事项
			在改造mip的过程中,很多同学遇到这样一个问题.mip无限滚动问题 异步请求数据接口(仅支持 JSONP 请求) 异步请求接口需要规范 callback 为 'callback' 那么什么是JSONP ... 
- const用法总结(通俗易懂)
			const的意思可以概括为 “一个不能被改变的普通变量” ,使得const在一定程度上提高程序的安全性和可靠性. const的几种情况: 1. const的普通用法 int const size: c ... 
- 删除警告的方法 python
			import warningswarnings.filterwarnings('ignore') 
- 调整图像的亮度和对比度—opencv
			1.理论基础 两个参数 和 一般称作 增益 和 偏置 参数.我们往往用这两个参数来分别控制 对比度 和 亮度 . 你可以把 看成源图像像素,把 看成输出图像像素.这样一来,上面的式子就能写得更 ... 
- WPF系列教程——(三)使用Win10 Edge浏览器内核 - 简书
			原文:WPF系列教程--(三)使用Win10 Edge浏览器内核 - 简书 在需要显示一些 H5网站的时候自带的WebBrowser总是显示不了,WebBrowser使用的是IE内核,许多H5新特性都 ... 
