Ir para o conteúdo principal
0

Por enquanto, esta lição está em inglês.

References must not outlive their data

A reference is useful only while the value it points at still exists. Rust checks this at compile time, so a dangling reference, a classic source of crashes in C, cannot be built. Sometimes the compiler needs you to describe the relationship, and that is what a lifetime is.