by koenigdavidmj · 11y ago · 0 comments
But what happens is that variables leave scope in reverse of the order in which they came in, so ref lives for slightly longer than val.
This happens so that the order of destructors can be guaranteed.
This happens because borrow scopes are always lexical. This is a bug, see https://github.com/rust-lang/rfcs/issues/811.
In this case, I think the term is justified.
I did, thanks.