Use this checklist to get from a blank machine to a Rust program you can run, test and explain in one sitting. Tick each item before moving on; skipped steps usually turn into confusing compiler errors later.
Install one stable toolchain and verify it
Start with rustup, the official installer and version manager, and add the stable toolchain only. Do not add nightly, beta, or a second compiler until you have a reason. The download and first toolchain install usually takes 20–40 minutes on a normal connection and may use 500 MB–1.5 GB of disk space, so clear that before you begin.
After installing, close and reopen the terminal. Run: rustc --version cargo --version Both should print a version. If either command is not found, the terminal has not picked up the path; reopen it or restart the machine. If the version is older than 1.80, run rustup update stable.
Create and run one disposable crate
Use Cargo, Rust's build tool and package manager, rather than compiling single files by hand. Run cargo new hello_rust, move into the folder, and open it in an editor that can show compiler errors. You should see exactly two important files at first: Cargo.toml and src/main.rs. Accept the default edition; changing editions in week one adds confusion without teaching anything useful.
Run cargo run. The first build takes roughly 5–20 seconds on a modern laptop; later builds are faster. If it prints Hello, world!, you have a working compiler, linker, and project layout. Delete nothing in target/ yet. That folder is build output and can easily reach 100 MB after a few small projects; it is safe to delete when you need space, and Cargo will recreate it.
Write a 40-line syntax sampler
Before reading about advanced Rust, write one program of about 40–60 lines that uses:
letandlet mut- a function with one parameter and a return value
- an
if/else - a
forloop over a range - a
matchwith two or three arms i32,f64,bool,String, and&strprintln!with{}and{:?}
Keep it in one file. The aim is not a useful program; it is to make the compiler tell you what it expects. If you cannot explain the difference between String and &str after this exercise, stop and ask; that distinction appears in many early errors.
Prove ownership with three small snippets
Ownership is the part beginners most often read without testing. Spend 15–20 minutes writing three tiny examples. First, move a String into a function and then try to use it afterwards; read the error. Second, borrow the same String with & and print it twice. Third, try two mutable borrows at once, then shorten one borrow's scope until it compiles.
The rule to remember is: at any one time, you can have either one mutable reference or any number of immutable references. Do not use .clone() to silence every error. Clone only when you genuinely need a second owned value. If a borrow error feels impossible, reduce the example to 5–10 lines; small examples are easier to reason about than a 100-line file.
Set up the four-command feedback loop
Install the two standard components with rustup component add rustfmt clippy. Then use four commands in a loop:
cargo fmtto formatcargo checkfor a fast type checkcargo clippy -- -D warningsfor lint feedbackcargo testfor tests
Run cargo check after every small change; it is usually faster than a full build. Add one #[test] for each function you write once you reach functions with logic, and keep the tiny test suite under 5 seconds. If clippy reports 20 warnings, fix the first two or three, rerun, and repeat.
Keep the dependency count at one
For your first working crate, allow yourself at most one external dependency. Add it only after the standard-library version compiles. Use cargo add once, inspect the change in Cargo.toml, and notice that Cargo.lock records exact versions. A single small dependency can add 10–60 seconds to a clean build; ten dependencies can add minutes and a pile of unfamiliar error messages.
Do not start with async runtimes, web frameworks, or game engines. They hide the core language behind macros and configuration. A command-line program of 20–40 lines that reads one argument and prints a result teaches more than a copied web template.
Diagnose a broken starter build: symptoms, causes, fixes
Symptom: cargo: command not found. Likely cause: the installer changed your shell path but the terminal is still using the old environment. Fix: close the terminal, open a new one, and run cargo --version again. If it still fails, rerun the installer and read the final path instructions.
Symptom: linker 'cc' not found or a long linker error. Likely cause: Rust is installed, but the system C linker or build tools are missing. Fix: install the standard build tools for your operating system, then run cargo clean and cargo run again.
Symptom: borrow of moved value. Likely cause: a String or other non-Copy value was passed by value and then used again. Fix: pass &value if the function only needs to read it, or move the later use before the move. Use .clone() only when ownership must be duplicated.
Symptom: cannot borrow as mutable. Likely cause: an immutable borrow is still alive, or two mutable borrows overlap. Fix: shorten the first borrow's scope with braces or reorder the lines so only one borrow is active at a time.
Symptom: dozens of errors after one change. Likely cause: you are reading the last error first, or a type error is cascading. Fix: fix only the first error, run cargo check, and repeat. Three to five errors after a beginner edit is normal; a list of 30 usually collapses once the first one is fixed.
Tick the starter checklist
Before you call the setup finished, confirm all ten:
rustc --versionandcargo --versionboth work in a fresh terminal.- You have one stable toolchain and no nightly toolchain.
cargo newcreates a project you can open and run.cargo runprints output without manual compiler flags.- You have written a 40–60 line program using variables, functions, loops, and
match. - You can explain move, immutable borrow, and mutable borrow using your own three snippets.
cargo fmt,cargo check,cargo clippy -- -D warnings, andcargo testall run.- Your first crate has no more than one external dependency.
- You fix the first compiler error before reading the rest.
- You know where
Cargo.toml,src/main.rs, andtarget/are, and what each is for.
If any box is unticked, fix that one item before adding a new topic.
FAQ
Do I need to install anything else after rustup?
Usually no for a first crate, but add rustfmt and clippy with one command and install your operating system's C build tools if cargo run reports a linker error. Do not add extra toolchains or a pile of crates before cargo run succeeds once.
Can I skip ownership at first?
You can delay deep trait and generic work, but not ownership. Every non-trivial program meets it. Write the three snippets in the checklist; if you skip them, borrow errors will look random. You do not need to memorise every rule, but you do need to recognise a move, a shared borrow, and a mutable borrow.
How long should the starter checklist take?
Most beginners need 3–6 focused hours spread over two or three sessions. The install is the slowest fixed step at 20–40 minutes; the syntax sampler and ownership snippets take about an hour each. If you are still stuck after six hours, reduce the program size and ask for help with the first error, not the whole file.