01 Install Rust
Goal
Set up a complete Rust development environment with rustup, cargo, and rust-analyzer.
Steps
1. Install rustup
bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFollow the prompts (default is fine). This installs:
rustc- the compilercargo- package manager and build toolrustup- toolchain manager
2. Configure Shell
bash
source ~/.cargo/envVerify:
bash
rustc --version
cargo --version
rustup --version3. Install Components
bash
rustup component add rust-analyzer rust-src rustfmt clippy4. Update Toolchain
bash
rustup updateCheckpoint
Run:
bash
cargo new hello
cd hello
cargo runExpected output:
Compiling hello v0.1.0 (...)
Finished dev [unoptimized + debuginfo] target(s) in 0.5s
Running `target/debug/hello`
Hello, world!Next
Continue to 02 Hello World.