by jmite · 9y ago · 0 comments
The trick is that if it is (possibly) returned from a function, it is moved instead of dropped.
It's also important to distinguish Box from Rc. Both are heap values but have very different behavior.
The word "reference" is overloaded, it can be used to mean "anything pointery that's guaranteed to exist" too. Box<T> in this context is a reference.
The post does kind of dance between definitions of "reference" a bit, but I think that's intentional.