AnyLearn
All lessons

rust

4 free lessons tagged rust across Programming. Each one is a short sequence of focused steps with narration and a five-question quiz at the end — take them in any order, no signup required.

Programming
advanced

Unsafe, and Where the Guarantee Actually Ends

The borrow checker rejects some correct programs, so Rust provides ways out: runtime-checked cells, reference counting, and unsafe blocks. This lesson covers what each escape hatch turns off, what it does not, and the encapsulation discipline that keeps a small unsafe core from voiding the guarantee for everything above it.

8 steps·~12 min
Programming
advanced

Fearless Concurrency: The Same Rule, Applied Across Threads

Rust did not add a concurrency safety mechanism. A data race requires aliasing plus mutation, which the borrow checker already forbids, so data races became compile errors as a side effect. This lesson shows how two marker traits extend that guarantee across threads, and what it still does not prevent.

8 steps·~12 min
Programming
advanced

Borrowing: Aliasing XOR Mutation

Moving a value to read it is unusable, so ownership needs a way to lend. The lending rule is one line, and it is the reason Rust can guarantee no dangling references: you may have many readers or one writer, never both. This lesson builds that rule and the lifetimes that enforce it across function boundaries.

8 steps·~12 min
Programming
intermediate

Ownership: One Rule That Replaces the Garbage Collector

Every language must decide who frees memory and when. Rust answers with a rule enforced at compile time: each value has exactly one owner, and it is freed when that owner goes out of scope. This lesson builds the rule, shows what moving a value means, and explains what the approach buys and charges.

8 steps·~12 min

Related topics