2017-11-27 09:58:49 -05:00
|
|
|
# rustup
|
|
|
|
|
|
|
|
> Install, manage, and update Rust toolchains.
|
2023-09-02 15:12:22 +02:00
|
|
|
> Some subcommands, such as `toolchain`, `target`, `update`, etc. have their own usage documentation.
|
|
|
|
> More information: <https://rust-lang.github.io/rustup>.
|
2017-11-27 09:58:49 -05:00
|
|
|
|
|
|
|
- Install the nightly toolchain for your system:
|
|
|
|
|
|
|
|
`rustup install nightly`
|
|
|
|
|
2017-11-30 09:51:01 -05:00
|
|
|
- Switch the default toolchain to nightly so that the `cargo` and `rustc` commands will use it:
|
2017-11-27 09:58:49 -05:00
|
|
|
|
|
|
|
`rustup default nightly`
|
|
|
|
|
2023-09-02 15:12:22 +02:00
|
|
|
- Use the nightly toolchain when inside the current project but leave global settings unchanged:
|
2018-02-18 13:35:09 -05:00
|
|
|
|
|
|
|
`rustup override set nightly`
|
|
|
|
|
2017-11-27 09:58:49 -05:00
|
|
|
- Update all toolchains:
|
|
|
|
|
|
|
|
`rustup update`
|
|
|
|
|
|
|
|
- List installed toolchains:
|
|
|
|
|
|
|
|
`rustup show`
|
|
|
|
|
2023-09-02 15:12:22 +02:00
|
|
|
- Run `cargo build` with a certain toolchain:
|
2017-11-27 09:58:49 -05:00
|
|
|
|
2023-09-02 15:12:22 +02:00
|
|
|
`rustup run {{toolchain}} cargo build`
|
2021-07-29 15:09:05 +02:00
|
|
|
|
2023-09-02 15:12:22 +02:00
|
|
|
- Open the local Rust documentation in the default web browser:
|
2021-07-29 15:09:05 +02:00
|
|
|
|
|
|
|
`rustup doc`
|