Update UnsafeUnpin impls involving extern types.#152646
Update UnsafeUnpin impls involving extern types.#152646zachs18 wants to merge 1 commit intorust-lang:mainfrom
UnsafeUnpin impls involving extern types.#152646Conversation
Also updates the marker_impls macro docs to use PointeeSized bound, as most uses of the macro now do.
|
r? @jhpratt rustbot has assigned @jhpratt. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I'm unfamiliar with the @rustbot reroll |
|
I see in the tracking issue for Sized hierarchy (#144404) this note:
This implies to me that either this isn't effective or there's something special about UnsafeUnpin's trait (maybe the fact it's Am I correctly interpreting that PointeeSized is the 'lowest rung' of the ladder currently proposed? It's confusing to me that the RFC's current text (https://github.com/davidtwco/rfcs/blob/sized-hierarchy/text/3729-sized-hierarchy.md#guide-level-explanation) has cc @davidtwco |
Yes, Either way, this would not affect the impls for This would be important for the
Yes, my understanding is that the name Footnotes
|
UnsafeUnpintracking issue: #125735Relaxes from
T: ?Sized(i.e.T: MetaSized) toT: PointeeSizedfor theUnsafeUnpinimpls for pointers, references, andPhantomData<T>, and for the negativeUnsafeUnpinimpl forUnsafePinned<T>. (Compare to the impls forFreezeon lines 911-921.)Both
UnsafeUnpinandextern types (the only way to have a!MetaSizedtype) are unstable, so this should have no effect on stable code.Also updates the marker_impls macro docs to use PointeeSized bound, as most uses of the macro now do.
Concretely, this change means that the following types will newly implement
UnsafeUnpin:TwhereTis anextern typePhantomData<T>whereTis an extern typeTis astructor tuple withextern typetailAdditionally, the negative
UnsafeUnpinimpl forUnsafePinned<T>is also relaxed toT: PointeeSizedto align with the analogous negativeFreezeimpl forUnsafeCell<T>, even though both structs haveT: ?Sizedin their declaration (which probably should be relaxed, but that is a separate issue), so this part of the change doesn't actually do anything currently, but ifUnsafeCellandUnsafePinnedare later relaxed toT: PointeeSized, then the negative impl will apply to the newly possible instantiations. Also cc #152645 that these impls compile at all.