Why Every Rust Developer Should Read the Rustonomicon

The Rustonomicon

Several times I’ve seen Rust developers dismiss the Rustonomicon - “it’s about unsafe code, I’ll never use that” or “it’s outdated.” This is wrong, and I think it’s one of the most underrated resources in the Rust ecosystem.

Yes, it covers unsafe. But that’s not the point.

The Rustonomicon teaches you how Rust actually works under the hood. Things you won’t find explained this well anywhere else:

  • Data layout - how structs get padded and reordered, why repr(C) vs repr(Rust) matters, what repr(transparent) actually guarantees
  • References in depth - aliasing rules, why &mut can’t be aliased, and how this enables compiler optimizations like eliminating redundant reads and keeping values in registers
  • Lifetimes beyond the basics - unbounded lifetimes, Higher-Rank Trait Bounds (for<'a>), why your closure sometimes needs explicit lifetime polymorphism
  • Subtyping and variance - why &'static str is a subtype of &'a str, why &mut T is invariant, and how PhantomData controls variance in std’s own types (look at thread::Scope source)
  • Drop mechanics - drop check, drop flags, why mem::forget is safe and what that means for your API design (it killed the old thread::scoped)
  • What Vec and Arc look like inside - and why understanding their internals changes how you think about your own data structures
  • Exception safety - why setting Vec’s length before initializing elements is a time bomb, and the drop guard pattern

This isn’t just “unsafe stuff.” It’s how the language thinks. After reading it, you’ll understand why the borrow checker rejects certain code, why some trait bounds exist, and why std is designed the way it is.

Every Rust developer should read it. Not to write unsafe code - but to write better safe code.