rust中的channel管理

rust有三种不同的版本:stable, beta, and nightly。分别叫做不同的channel。不同的channel,功能是不同的,stable是默认的版本,也是正式版。

而beta和nightly有一些试验性的功能,可以理解为体验版。比如nightly里面就有bench的功能。

当在本机安装某个channel的时候,实际上是安装对应的toolchain,是具体的软件本身,其中比较重要的是rustc编译器和cargo包管理工具。

可以理解为channel是一个概念,toolchain是channel具体对应的一系列软件。

在不同的channel之间切换,就需要用到rustup工具。

下面是一些常见的rustup指令:

查看本地安装的channel

$ rustup toolchain list

安装某个channel,以安装nightly为例:

$ rustup toolchain install nightly

切换channel,channel的切换一般有几种方式:

  1. 永久更改系统默认channel
rustup default nightly
  1. 临时更改channel。在执行cargo指令时指定channel版本,这样不会改变系统默认channel
rustup run nightly cargo build 
或者: 
cargo +nightly build
  1. 设置当前项目使用的channel。在项目目录下执行以下指令,可以更改当前项目的channel,不影响其他项目:
rustup override set nightly

总结:

  • rust有三个channel: stable, beta, nightly
  • 每一个channel都有自己的一套toolchain,主要是rustc和cargo
  • 通过rustup在不同channel之间切换,可以临时切换,永久切换和针对项目切换

Ref



《 “rust中的channel管理” 》 有 4 条评论

  1. lasix online In isolated tissue preparations, all compounds were prepared as stock solution for each concentration in absolute ethanol and added to the bath chamber in a final volume of 0

  2. Nagourney was a chemistry major as an undergraduate before he getting his M buy cytotec online The train last night was carrying 400 people and struck a SUV stuck on the railroad tracks killing the driver of that vehicle and at least five passengers on the train

  3. Monitor Closely 1 crofelemer increases levels of cabozantinib by affecting hepatic intestinal enzyme CYP3A4 metabolism priligy sg This is very interesting to me as when I had tests for multiple sclerosis in 2016 my lumbar puncture found my pressure to be very high 28

  4. And if yes, which tissues and cancer types could be affected priligy canada

回复 agodelo 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

About Me

一位程序员,会弹吉他,喜欢读诗。
有一颗感恩的心,一位美丽的妻子,两个可爱的女儿
mail: geraldlee0825@gmail.com
github: https://github.com/lisuxiaoqi
medium: https://medium.com/@geraldlee0825