3 ms·
Well, only for Box<> pointers, but yes
by doomrobo 12y ago
Well, only for Box<> pointers, but yes
- masklinn 12y agoOwnership is for all structures on the stack. Box is little more than a rust-level wrapper around a raw pointer (well technically around a core::ptr::Unique which is the actual wrapper around a raw pointer)
- dbaupp 12y agoWhich part are you referring to with "only"? There's nothing particularly special about Box, at least, not in relation to the things the parent mentioned.
- doomrobo 12y agoWhoops, misread "zero" as "deallocate". I meant that Box<> pointers are heap-allocated but deallocated when they go out of scope.