You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: Pin<P> fails two guarantees of StableDeref, even when Target: !Unpin: it does not guarantee that <P as Deref>::deref and <P as DerefMut>::deref_mut go to the same place, and it does not even guarantee that two invocations of <P as Deref>::deref go to the same place.
The text was updated successfully, but these errors were encountered:
I'm not sure how failing to satisfy these would break safety in crates like rental or owning_ref though. Any clue?
EDIT: Oh nevermind I found: if Deref points to somewhere that moves when the struct moves (e.g. &self.some_field), it breaks. Pin seems to not guarantee that is not the case.
Discussion on urlo.
TL;DR:
Pin<P>
fails two guarantees ofStableDeref
, even whenTarget: !Unpin
: it does not guarantee that<P as Deref>::deref
and<P as DerefMut>::deref_mut
go to the same place, and it does not even guarantee that two invocations of<P as Deref>::deref
go to the same place.The text was updated successfully, but these errors were encountered: