Closed BenMaruchu closed 4 years ago
Actually the statement is correct. At compile time rustc checks the lifetime annotations. Lifetimes allows for safe memory management at runtime. Basically at compile time it checks if a variable will be used afterwards or can be fred after for instance exiting a function. According to that "plan", at runtime the variable will be fred.
Sorry for the late reply.
In Rust, lifetime annotations are checked at compile-time, not in run-time. But according to the annotation checks, it tweaks things while compiling for run-time. So, it can guarantee the memory safety at run-time.
Hope these answers were helped to remove your confusions. However, use Rust's sub Reddit or official communication channels for a quick response next time :)
Thanks @dumindu , @FedericoPonzi for the answers.
Hello,
Thanks everyone for this amazing resource for learning rust. I have a question regarding a section in lifetime section.
was this suppose to say
Rust manages memory at compile time ...
and not...in run time...
based on the context of the statement?