You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ).
The text was updated successfully, but these errors were encountered:
I am not working on the book at the moment, given that I'm working on the second edition. If someone wants to send me a PR for this, I'd take it, though!
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 ).
The text was updated successfully, but these errors were encountered: