<Dropper as Drop>::drop is passed an unaligned reference to Dropper, which is UB.
cc @rust-lang/lang
It doesn't look unaligned https://play.rust-lang.org/?gist=377fe5fbb00ecd7bf72c94a2b2a38fb8&version=stable&mode=debug&edition=2015
@sfackler Putting Drop types in a #[repr(packed)] structure should also be deprecated, then.
Ah, nevermind; apparently, we generate a shim that copies the value before calling drop on it. We should document this.
cc @arielb1
Is it possible to break it if Dropper is immovable?
@alercah @RalfJung just left a comment about that on the Pin tracking issue.
@ubsan what would be a good place to document this? Do we have attribute docs so we can put it with repr(packed)?
Might be worth reopening (and renaming) this issue to track that missing doc.
The reference seems like the right place for it.
Or the Rustonomicon?
I think the long-term vision should be the reference holding normative text, and the 'Nomicon being more of a practical guide. So probably the correct answer is both.
re-filing against the reference https://github.com/rust-lang-nursery/reference/issues/488
if anyone wants to put this in the nomicon, they can, but it's optional, IMHO.
Most helpful comment
I think the long-term vision should be the reference holding normative text, and the 'Nomicon being more of a practical guide. So probably the correct answer is both.