If lifetimes are everywhere, why have you written almost none? Because the compiler applies elision rules — a set of defaults that fill in the obvious cases so you don't have to.
The three elision rules
One: each reference parameter gets its own lifetime. Two: if there's exactly one input lifetime, it's assigned to all outputs. Three: if there's a &self parameter (a method), its lifetime is assigned to all outputs. These three cover the overwhelming majority of functions — which is why fn first_word(s: &str) -> &str needs no annotation: rule two assigns the single input's lifetime to the output.
When elision can't decide
The longest function fails elision because it has two input lifetimes and rule two doesn't apply — the compiler can't guess which one the output borrows from. That's the precise gap where you step in and annotate. Elision handles the obvious; you handle the ambiguous.
'a when the compiler tells you it can't infer the relationship — let it ask before you annotate.The special lifetime: 'static
'static means 'valid for the entire program.' String literals are &'static str — baked into the binary and never freed. It's a real, useful lifetime, but beginners sometimes slap 'static on things to silence errors, which usually masks a deeper ownership problem. Use it when the data truly lives forever, not as an error-silencer.