Installation
Rust Compiler
The recommended way to install Rust is using rustup.
Rustup is an official first-party tool which allows you to install and manage versions of rustc (the rust compiler), cargo (the rust build tool), clippy (the rust linter), rustfmt (the rust code formatter) and more. It allows you to easily upgrade to the latest version of rust, and to have multiple versions of Rust concurrently.
To install Rust using rustup:
-
On macOS or Linux, run:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- On Windows, download and run rustup-init.exe
More details and documentation on rustup are available in the rustup book.
It is not recommended to install Rust through your distribution package manager. These packages are intended to compile programs packaged by the distribution, not for Rust development, and they are often so outdated that the latest versions of libraries won't compile.