rustupRust is constantly evolving with new features, optimizations, and security patches. Keeping your Rust installation up to date ensures you’re taking advantage of the latest improvements. However, you might be concerned about how upgrading Rust affects your existing projects.
In this post, we’ll cover:
rustuprustupBefore upgrading, it’s useful to check which Rust version you’re currently using. Run the following command in your terminal:
rustc --version
This will output something like:
rustc 1.85.0 (2025-02-23)
You can also check the installed version of Cargo (Rust’s package manager):
cargo --version
For more detailed information about your Rust installation and toolchains, run:
rustup show
rustupIf you don’t have Rust installed yet, the recommended way to install it is using rustup. rustup is a toolchain installer that makes it easy to manage Rust versions.
rustupFor Linux and macOS, run:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
For Windows, download and run the installer from rustup.rs.
After installation, restart your terminal and check that Rust is installed by running:
rustc --version
This should print the installed Rust version.
rustupThe easiest and safest way to upgrade Rust is by using rustup, the official Rust toolchain manager.
rustup Itself (Optional but Recommended)rustup self update
rustup update stable
Once the update is complete, verify the new Rust version with:
rustc --version
You should see the latest version, confirming that the update was successful.
Upgrading Rust does not usually break your existing projects because Rust is designed to be highly backward-compatible. However, here’s what you need to know:
rust-toolchain File)If your project has a rust-toolchain file in its root directory specifying a specific Rust version (e.g., 1.75.0), then upgrading Rust won’t affect that project. Check if your project has this file:
cat rust-toolchain
If it contains:
1.75.0
Your project will continue using Rust 1.75.0, even if you upgrade Rust globally.
rustup override to Set a Local VersionYou may have manually set a specific Rust version for a project or directory using:
rustup override set 1.75.0
In this case, even after updating Rust globally, that project will still use Rust 1.75.0. To remove the override and use the latest Rust version, run:
rustup override unset
If you experience issues after upgrading, you can easily revert to an older Rust version:
rustup install 1.75.0
rustup default 1.75.0 # Set this version globally
Or, for a specific project:
rustup override set 1.75.0
rustc --version.rustup is the recommended way to get started.rustup is straightforward with rustup update stable.rust-toolchain or rustup override) won’t be affected by global upgrades.rustup.By understanding these details, you can confidently keep your Rust installation up to date while ensuring your projects remain stable. Happy coding! 🚀