mirror of
https://github.com/rust-lang/book.git
synced 2026-05-17 05:00:42 -04:00
I couldn't find any documentation of how `redirects/` dir is being used, but fixed inlined format args for consistency
814 B
814 B
% Lifetimes
There is a new edition of the book and this is an old link.
Every reference in Rust has a lifetime, which is the scope for which that reference is valid. Most of the time lifetimes are implicit and inferred.
{
let x = 5; // -----+-- 'b
// |
let r = &x; // --+--+-- 'a
// | |
println!("r: {r}"); // | |
// --+ |
} // -----+
Here are the relevant sections in the new and old books: