Search courses or pages...
Install Rust through rustup and verify that your terminal can find the tools. You’ll recognize rustup as the toolchain manager, rustc as the compiler, and Cargo as Rust’s project runner and package tool.
Create a fresh project with `cargo new` and move into its folder from the terminal. You’ll see how Cargo gives your program a standard home instead of leaving you to manage loose files by hand.
Open the project and identify what `Cargo.toml` and `src/main.rs` each do. You’ll learn that the manifest describes the package, while `main.rs` is where the starting code for this small program lives.
Apply the previous explanations in a guided problem.
Run the starter program with `cargo run` and trace what happens: Cargo compiles the code, stores build output in `target`, then launches the program. You’ll separate Cargo’s build messages from your program’s printed output.
Change the text inside `println!` and run the program again to see your edit take effect. You’ll treat `println!` as the standard way this first program writes a line to the terminal, without diving into macros yet.
Use `cargo build` when you want an executable without immediately running it. You’ll recognize where Cargo places the built program and why building and running are related but separate actions.
Use `cargo check` to ask Rust whether the project compiles before making a full executable. You’ll practice the fast feedback loop Rust developers use while editing code.
Break the program in a small way and read the compiler message from top to bottom. You’ll locate the error code, file name, line number, caret marker, and help text instead of treating the message as a dead end.
Check your understanding with a short quiz.
Apply one compiler suggestion, rerun Cargo, and confirm the program works again. You’ll practice using compiler feedback as part of the normal write-run-fix cycle for Rust programs.
Review this chapter with practice based on your mistakes.