News for hackers. Stuff that matters.
Re:Rust 2024 the Year of Everywhere? by Ygg2 on Friday September 23, 2022 @05:19PM (#32957209)
> 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,
   }

There are no comments on this comment yet.