红穆笔记

rustup

安裝、管理和更新 Rust 工具鏈。 一些子命令,如 `toolchain`、`target`、`update` 等有自己的使用文檔

100% 瀏覽器本地處理 0 數據上傳

常用示例

爲你的系統安裝 nightly 工具鏈

rustup install nightly

將默認工具鏈切換爲 nightly 以便 `cargo` 和 `rustc` 命令使用它

rustup default nightly

在當前項目中使用 nightly 工具鏈,但保持全局設置不變

rustup override set nightly

更新所有工具鏈

rustup update

列出已安裝的工具鏈

rustup show

使用指定工具鏈運行 `cargo build`

rustup run {{工具鏈}} cargo build

在默認網頁瀏覽器中打開本地 Rust 文檔

rustup doc

提示:花括號{{…}}是需要替換的參數(路徑、文件名等);命令只在本機終端執行,本站不保存任何輸入。

英文原文對照

展開英文說明與示例(來源 tldr-pages)

Install, manage, and update Rust toolchains. Some subcommands, such as `toolchain`, `target`, `update`, etc. have their own usage documentation. More information

Install the nightly toolchain for your system

rustup install nightly

Switch the default toolchain to nightly so that the `cargo` and `rustc` commands will use it

rustup default nightly

Use the nightly toolchain when inside the current project but leave global settings unchanged

rustup override set nightly

Update all toolchains

rustup update

List installed toolchains

rustup show

Run `cargo build` with a certain toolchain

rustup run {{toolchain}} cargo build

Open the local Rust documentation in the default web browser

rustup doc

命令信息

命令名rustup
用途安裝、管理和更新 Rust 工具鏈。 一些子命令,如 `toolchain`、`target`、`update` 等有自己的使用文檔
適用平臺通用
示例數量7 條
官方文檔https://rust-lang.github.io/rustup/
數據來源tldr-pages(CC-BY-4.0)· 社區中文翻譯

常見問題

rustup 命令是做什麼的?

安裝、管理和更新 Rust 工具鏈。 一些子命令,如 `toolchain`、`target`、`update` 等有自己的使用文檔

rustup 怎麼用?

頁面按場景列出了7 條常用示例:每條示例先說明用途,再給出可直接複製的完整命令(花括號裏是需要替換的參數)。

rustup 最常用的操作是什麼?

爲你的系統安裝 nightly 工具鏈:rustup install nightly

命令裏的花括號是什麼意思?

花括號{{…}}表示需要替換成你自己的值,例如路徑、文件名;同名參數方括號(如 [-C|--directory])表示可選寫法。