Hi,
Since rust doesn't have a garbage collection, what would happens to the allocated memory when the variable holds that address and doesn't go out of scope?
For Example:
let mut five = Box::new(5); // LINE 1
five = Box::new(5); // LINE 2
What would happen to the allocated memory in LINE 1 when five doesn't go out of scope?? since five holds a new allocated memory.
Copy values can't have special implementations of Drop, so it's just overwritten. As a side note, your code wouldn't work because you didn't make the variable mutable.