Skip to content

Helpful resources for references

References › Reading list

Level: reference · the reading list

One line: For each part of the references path, the book chapters, docs, papers and articles that cover the same idea — with chapter names as well as numbers, because numbers move between editions — and the sources to read with care, each with what is wrong in it.

Every link was checked on 2026-09-16. A print book is cited only by the chapter and section headings its own pages show, so "covers" means a section is titled for the idea, not that every paragraph was read.

If you read only four

  • The Rust Programming Language, ch. 4.2 — References and Borrowing ↗ — &, &mut, the two rules, and the dangling reference the compiler refuses. The page everyone starts from.
  • Programming Rust, 2nd ed. (Blandy, Orendorff & Tindall, O'Reilly 2021) — ch. 5 "References", in particular "Reference Safety" and its first case, "Borrowing a Local Variable": how the compiler assigns each reference a lifetime and works out the constraints between them. The deepest book treatment of why a reference program is refused.
  • Stacked Borrows: An Aliasing Model for Rust ↗ (Jung, Dang, Kang & Dreyer, POPL 2020), §2 "An Introduction to Rust" — four pages that state the exclusion principle and explain borrow checking as loans with lifetimes. No formal background needed for §2; §3 onwards is the model for unsafe code. A borrow is a loan runs its programs.
  • reference ↗ and pointer ↗ — the std pages for &T/&mut T and *const T/*mut T: which traits every reference implements, and the list of things a raw pointer promises nothing about.

By part of the path

Borrowing, loans and lifetimes

Pointer types, Box and Rc

ref and patterns

Dereferencing

Raw pointers and unsafe

Writing through a shared reference

Videos

Titles and channels checked through YouTube's oEmbed endpoint on 2026-09-16; the timestamps are the authors' own chapter marks from each video's description, not a transcript read here.

Read with care

Good sources, each with something that does not compile or no longer holds on rustc 1.98.0. The evidence for each is on What reference explanations get wrong, run.

  • The Stack Overflow thread (2015–2026). The accepted answer (2015) is still the best short overview of Box, ref, & and *, but its pointer snippet takes &mut x of a let x that is not mut, its *mut SomeTrait has been an error since edition 2021, and "Box<T> always takes a pointer's worth of bytes" is false for Box<str> and Box<dyn Trait>. The table answer (2022) mixes up where the pointer lives with where the data lives, and calls three non-owning pointers "shared ownership". Its last line, "ref is the same as &", equates two pattern forms that do opposite things.
  • The Book, ch. 4.2. The E0596 transcript for Listing 4-6 comes from an older rustc: 1.98.0 says "so it cannot be borrowed as mutable" and suggests the fix as a diff.
  • The Book, ch. 15.4. "for reading only" describes Rc<T> through Deref; Rc::get_mut writes in place when the count is one, and Rc::make_mut clones first when it is not.
  • Programming Rust, 2nd ed. "At run time, a reference is nothing but an address" holds for a reference to a sized type; a &str or &[T] also carries a length.
  • Cliffle, part 2 (written against rustc 1.39). offset_Momentum(&mut solar_Bodies) on a static mut is a warning in edition 2021 and an error in edition 2024.

Po polsku

Lista lektur do ścieżki o referencjach. Najkrócej: rozdział 4.2 The Rust Programming Language (referencje i pożyczanie), rozdział 5 Programming Rust („Reference Safety”), sekcja 2 artykułu Stacked Borrows (zasada wykluczania i pożyczki z czasem życia) oraz strony reference i pointer w dokumentacji std. Sekcja „Read with care” wymienia źródła, które warto czytać, ale z poprawkami — wątek na Stack Overflow, fragmenty The Book, Programming Rust i kursu Cliffle'a — a dowody (wyniki kompilatora) są na stronie z twierdzeniami sprawdzonymi na rustc 1.98.0.

Szukaj po polsku: referencje w Ruście · pożyczanie · zasada wykluczania · rust stacked borrows · rust ref keyword · rust raw pointer vs reference