bhylu.com

Advertisements

Rust Installation and Cargo

Verify the reviewed compiler and package manager.

How it works

The reviewed baseline is Rust 1.97.0 with edition 2024. Editions select language compatibility rules; they are not compiler version numbers. Cargo manages packages, builds and tests, while rustc performs compilation. Install Rust through the official instructions for your operating system in your own learning environment. The website review uses a private project-local toolchain without modifying global PATH.

Run the code

Reviewed with Rust 1.97.0, edition 2024, using the standard library only. Save the complete download as lesson-name.rs in a separate learning folder, compile with rustc --edition=2024 lesson-name.rs and run the resulting program (lesson-name.exe on Windows). Use the actual lesson filename. The final project includes complete Cargo package files; run cargo test --offline and cargo run --offline from that separate package folder. There is no Rust browser runner; PHP, Apache and MySQL are not needed.

This complete example was executed in the stated local review environment.

Download complete source

Example

installation.rs

fn main() {
    println!("Local lessons target Rust 1.97.0 and edition 2024");
}

Expected result

Local lessons target Rust 1.97.0 and edition 2024

After installation, inspect rustc --version and cargo --version. For a new local package, cargo new seed-desk creates Cargo.toml and src/main.rs; cargo run builds and runs it, and cargo test runs tests. This tiny program was compiled with the stated toolchain, but printing a version statement itself is not a version-detection API.

Primary technical reference: Rust documentation.