Rust Cheat Sheet

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the section bibliography.

A single-page, colour-coded summary of the Rust language, written against Rust 1.99.0 and the 2024 edition (checked 2026-10-06) — the rustup and cargo command map and a Cargo.toml skeleton with features, profiles, [lints] and a workspace, primitive types, literals and casts, let/mut/const/static and shadowing, control flow with loop values, labels, if let, let-else and let chains, the ownership and borrowing rules in one box with the lifetime elision rules, structs, enums and pattern syntax, Option/Result combinators and ? with an error-type recipe, collection, string and iterator one-liners, generics versus impl Trait versus dyn Trait, closures and the Fn traits, a smart-pointer and interior-mutability chooser, the Send/Sync table, threads, channels and async, modules and visibility, macro_rules! fragment specifiers, the unsafe superpowers, testing and tooling flags, and a strip of what changed since older tutorials — handy for quick memorization or as a downloadable PDF desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Start here — Rust Reference.