3 ms·
> there is no way to create a "Pin<i32>" Caveat, I haven't worked with Pin that much. Take this with a grain of salt. My understanding is - you really shouldn
by Ygg2 4y ago
> there is no way to create a "Pin<i32>"
Caveat, I haven't worked with Pin that much. Take this with a grain of salt.
My understanding is - you really shouldn't put copyable stuff in Pin. Period. If you want something like that wrap i32 in new struct and declare it !Unpin. Since negative traits are unstable, you just write PhantomPinned marker
struct NonPinI32 {
v: i32,
non_pin: PhantomPinned,
}