lifetime
The stretch of the program in which a reference is valid.
A lifetime is the region of a program during which a reference is guaranteed valid.
Loading interactive…
Examples
let r; { let word = String::from("hi"); r = &word; } println!("{r}");fails with E0597:worddoes not live long enough.