C.W.K.
Stream
Lesson 02 of 06 · published

rustup, cargo, rustc — The Toolchain

~10 min · foundations, cargo, rustup, tooling

Level 0Rust Curious
0 XP0/80 lessons0/19 achievements
0/100 XP to next level100 XP to go0% complete

Rust ships as a small toolbox, not a single binary. Three names do almost all the work, and knowing which is which saves you a lot of confusion.

rustup — the version manager

rustup installs and switches Rust toolchains. Think of it as nvm for Node or pyenv for Python. It manages which compiler version you're on, which release channel (stable, beta, nightly) you use, and which compile targets you have installed (so you can cross-compile for ARM, WebAssembly, and friends).

rustc — the actual compiler

rustc is the program that turns .rs source into a binary. You almost never call it by hand — it has no notion of dependencies or project layout. It compiles files. That's it. The one time you'll reach for it directly is rustc --explain E0382, which prints a full essay on any error code.

cargo — the one you actually use

cargo is the front door. It wraps rustc, resolves dependencies from crates.io, runs your tests, builds your docs, and understands project structure. Ninety-five percent of your Rust life is cargo subcommands: cargo new, cargo run, cargo build, cargo test, cargo check.

cargo check is your fastest friend. It type-checks and borrow-checks your whole project without producing a binary — far faster than a full cargo build. Run it constantly while you work; save the full build for when you actually need to run something.

Release channels & editions

Rust ships a new stable release every six weeks — small, backward-compatible, never scary. nightly exists for unstable experimental features behind feature flags. Separately, the edition (2015 / 2018 / 2021 / 2024) in your Cargo.toml picks which language idioms a crate uses. A new compiler still compiles old editions, so upgrading your toolchain never breaks old code — and adopting a new edition is your deliberate, per-crate choice. (Cinder's native core, for instance, runs on edition 2021 even though 2024 is out — editions are opt-in, not a treadmill.)

Code

Install and verify the toolchain·bash
# Install rustup (and with it, a stable rustc + cargo)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Confirm what you have
rustc --version   # rustc 1.95.0 (...)
cargo --version   # cargo 1.95.0 (...)
rustup show       # active toolchain + installed targets

# Update later, any time
rustup update
Cargo.toml — where the edition lives·toml
[package]
name = "hello-rust"
version = "0.1.0"
edition = "2024"   # opt into the latest idioms; 2021 is still everywhere

[dependencies]
# crates from crates.io go here, e.g.:
# serde = { version = "1", features = ["derive"] }

External links

Exercise

Install rustup, then run rustc --version, cargo --version, and rustup show. Now run rustc --explain E0382 — you haven't hit that error yet, but read what the compiler says about it anyway. In one sentence, what is E0382 about?
Hint
E0382 is the 'use of moved value' error — the single most common thing beginners hit. Reading it now means it won't surprise you in the Ownership track.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue
💛 by Ttoriwarm

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.