Rustup
There are many ways to install Rust on your system. For the moment the official way to install Rust is using Rustup.
π Rustup installs The Rust Programming Language from the official release channels, enabling you to easily switch between stable, beta, and nightly compilers and keep them updated. It also makes cross-compiling simpler with binary builds of the standard library for common platforms.
π Rustup installs rustc, cargo, rustup and other standard tools to Cargo’s bin directory. On Unix it is located at $HOME/.cargo/bin and on Windows at %USERPROFILE%\.cargo\bin. This is the same directory that cargo install will install Rust programs and Cargo plugins.
π The main tools Rustup installs to the Cargo’s
bindirectory,
rustc: The Rust compiler.cargo: The Rustβs built-in package manager and the build system.rustup: The Rust toolchain installer.rustfmt: The Rustβs official tool of formatting Rust code according to style guidelines.cargo-fmt: Helps to runrustfmton whole Rust projects, including multi-crate workspaces.cargo-clippy: A lint tool that provides extra checks for common mistakes and stylistic choices.cargo-miri:An experimental Rust interpreter, which can be used for checking for undefined-behavior.rustdoc: A local copy of the Rust documentation.rust-analyzer: A language server that provides support for editors and IDEs.rust-gdbandrust-lldb: Rust debuggers that wrap the GNU Debugger(GDB) and Low-Level Debugger(LLDB).
Installation
For Mac and Linux Users
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
For Windows Users
Download rustup-init.exe from www.rustup.rs and run.
π‘ You may need to install Visual C++ Build Tools 2019 or higher, which requires an additional 3β4 GBs.
π¨βπ« Before going to the next…
- To verify the current Rust version, use the
rustc --versionor shorter formrustc -Vcommand. - Rust follows six week release cycles. Use the
rustup updatecommand to update the Rust ecosystem. - You can access Rust’s offline documentation via the
rustup doccommand. - For a full list of
rustupcommands, refer to therustup --helpcommand.