Memory ReasoningExplicit Lifetimes
All courses

How long do references live?

Lifetimes ('a) annotate how long references are valid. Often elided — the compiler infers them. Sometimes you must write them explicitly in generic functions.

Quirk: Lifetime errors are verbose. Read the full message — it usually tells you exactly what to fix. Eventually.

Output
Press Run to execute your code.