Rust Installation and Setup Guide
Get started with Rust programming - from installation to your first project. Includes verification steps and interactive quizzes.
1. Why Rust?
Key Features:
- Memory safety without garbage collection
- Blazingly fast performance
- Zero-cost abstractions
- Excellent tooling (Cargo, rustfmt, clippy)
Pre-Installation Quiz
Rust is particularly good for:
2. Installing Rust
All Platforms (Recommended)
# Install rustup (Rust toolchain installer)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Follow the on-screen instructions
# This installs:
# - rustc (compiler)
# - cargo (package manager)
# - rustup (toolchain manager)
Windows Specific
# 1. Download rustup-init.exe from rustup.rs
# 2. Run installer
# 3. Install Visual Studio Build Tools when prompted
Installation Quiz
What does rustup install by default?
3. Verify Your Installation
# Check Rust version
rustc --version
# Should return something like: rustc 1.65.0 (897e37553 2022-11-02)
# Check Cargo version
cargo --version
# cargo 1.65.0 (4bc8f24d3 2022-10-20)
# Check installation components
rustup show
Verification Quiz
Which command shows installed toolchains?
4. Create Your First Project
# Create new project
cargo new hello_world
cd hello_world
# Project structure:
# hello_world/
# ├── Cargo.toml # Project manifest
# └── src/
# └── main.rs # Entry point
# Build and run
cargo run
# Output: Hello, world!
Project Quiz
Where is the main function located in a new Cargo project?
5. Essential Development Tools
rustfmt (Code Formatter)
# Install
rustup component add rustfmt
# Format your code
cargo fmt
clippy (Linter)
# Install
rustup component add clippy
# Run linter
cargo clippy
Tools Quiz
What does cargo fmt do?
6. IDE Configuration
VS Code (Recommended)
- Install rust-analyzer extension
- Install Better TOML for Cargo.toml
- Install CodeLLDB for debugging
Other Editors
- IntelliJ IDEA with Rust plugin
- Neovim with coc-rust-analyzer
- Emacs with lsp-mode
IDE Quiz
Which VS Code extension provides Rust language support?
7. Keeping Rust Updated
# Update Rust toolchain
rustup update
# Update specific components
rustup component add rust-src # For documentation
# Check for outdated dependencies
cargo outdated
Maintenance Quiz
How do you update your Rust installation?
×