Conceptual
Login

Lifetimes in Rust

A lifetime names the region of code for which a reference is valid; generic lifetime parameters like <'a> let function signatures state how output references relate to input ones. Lifetimes are descriptive, not prescriptive: annotations never extend how long data lives, they only constrain what the compiler accepts.

This Concept is waiting for its first lesson!

A lifetime names the region of code for which a reference is valid; generic lifetime parameters like <'a> let function signatures state how output references relate to input ones. Lifetimes are descriptive, not prescriptive: annotations never extend how long data lives, they only constrain what the compiler accepts.

Are you a teacher? Sign in to start contributing.

Sign In