Add PhantomData
marker for dropck to BTreeMap
by steffahn · Pull Request #99413 · rust-lang/rust (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is yet another reminder for us that we need something more intuitive than PhantomData. PhantomData is used to control Send, Sync, dropck, UnwindSafe, UnwindSafeRef, variance, and Unpin. Possibly more (in the future). It happens so often that we try to control just some of these, and accidentally end up affecting one of the others too. (Like what would've happened here if (K, V) wasn't wrapped in a Box.)
cc @rust-lang/lang