Re: [PATCH v2 1/3] rust: add UnsafePinned type

From: Ralf Jung
Date: Fri May 02 2025 - 05:03:54 EST


Hi all,

If you have a link to somewhere that explains that hack, then I'd also
put it there. I forgot if it's written down somewhere.

I haven't found anything that describes the hack in detail.
From what I understand its a combination of disabling `noalias`
[0] (this PR enables it for `Unpin` types) and disabling
`dereferencable` [1] on `&mut !Unpin` types.
Related rust issue about this [2].

Maybe Alice, Ralf or someone else form the rust side can provide
a better reference?

The `!Unpick` hack simply removes `noalias` and `dereferenceable` from `&mut !Unpin` and `Box<!Unpin>` types (similar to how we already remove `noalias` and `dereferenceable` from `&!Freeze` types). This is not a stable guarantee and will probably change in future version of the compiler.

Kind regards,
Ralf