2 ms·
One thing I find deeply unintuitive about Pin: Pin means “this object will never ever be moved,” not “this object will not be moved while it is pinned.” I can
by amluto 7y ago
One thing I find deeply unintuitive about Pin: Pin means “this object will never ever be moved,” not “this object will not be moved while it is pinned.”
I can imagine an easier-to-understand world in which there is a reference type from which one cannot move during the lifetime of the reference, and in which one only ever gets this type of reference to immovable closures and such. I don’t know if the details would work out, but it would at least seem less weird to me.
- withoutboats 7y agoThe name for that reference type is a shared reference. It's literally the default reference type. It's not a sufficient guarantee for the use cases Pin supports.