Closed
Description
In reading about shadowing I was curious if shadowing a binding within the same scope would cause a destructor to be called, which I did eventually find is not the case https://www.reddit.com/r/rust/comments/2eelew/unexpected_for_me_behavior/?ref=share&ref_source=link, but perhaps this should be mentioned in the book to prevent incorrect assumptions from being formed (it's happened at least once).
There is currently an example of a binding being shadowed in a new scope and then the old value being used again, but I don't think this is enough for people to make the connection that shadowing never destroys a value ( they could think that the compiler keeps track of whether or not a binding is used again in the same scope ).
Metadata
Metadata
Assignees
Labels
No labels