static lifetime
A reference that is valid for the whole run of the program, like a string literal.
'static is the lifetime of the entire program; &'static T refers to data that is never freed, while T: 'static means T holds no borrow shorter than that (owned data qualifies).
Loading interactive…
Examples
let s: &'static str = "spring";is fine because a literal is stored in the program itself and never freed.
See also