跳转到内容

Rust 工具链

Channels: Rust 有 stable, beta, nightly 三个 channel

安装 nightly
$ rustup toolchain install nightly
info: syncing channel updates for 'nightly'
info: downloading toolchain manifest
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'rust-docs'
info: downloading component 'cargo'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'rust-docs'
info: installing component 'cargo'
nightly installed: rustc 1.9.0-nightly (02310fd31 2016-03-19)
设置为默认
$ rustup default nightly
info: using existing install for 'nightly'
info: default toolchain set to 'nightly'
nightly unchanged: rustc 1.9.0-nightly (02310fd31 2016-03-19)
添加 Components
# 安装并指定添加 component
rustup toolchain install nightly --component rust-docs
# 为当前 toolchain 添加 component
rustup component add rust-docs
交叉编译
$ rustup target add arm-linux-androideabi
info: downloading component 'rust-std' for 'arm-linux-androideabi'
info: installing component 'rust-std' for 'arm-linux-androideabi'
$ cargo build --target=arm-linux-androideabi

.cargo 配置文件

attributes 列表