|
|
|
|
|
by wisnoskij
1327 days ago
|
|
Ah, so this probably tells the compiler where to insert the free? If I gave it a local lifetime it would free the memory on function return for example, even if I tried to return a reference to it? Basically Rust just forces you to code in the memory freeing at the definition state of variable creation? |
|
Basically they turn use-after-free errors into compile errors.
(I'm using 'free' here to mean cleaned up in general. Lifetimes can track stack values.)