drop
What happens to a value when its owner goes away: it is cleaned up.
Dropping a value runs its Drop implementation, if any, and frees the memory it owns.
Loading interactive…
Examples
A
Stringdeclared inside an inner block has its heap buffer freed at that block's closing brace, before the outer variables are dropped.
See also