Lines Matching refs:UnsafeUnpin
89 /// This trait is used in conjunction with the `UnsafeUnpin` argument to
107 /// To help highlight this unsafety, the `UnsafeUnpin` trait is provided.
110 /// your `UnsafeUnpin` impl. However, this trait is `unsafe` - since your type
112 /// you must be sure that your `UnsafeUnpin` impls follows all of
115 /// Note that if you specify `#[pin_project(UnsafeUnpin)]`, but do *not*
116 /// provide an impl of `UnsafeUnpin`, your type will never implement [`Unpin`].
125 /// An `UnsafeUnpin` impl which, in addition to requiring that structurally
129 /// use pin_project::{pin_project, UnsafeUnpin};
131 /// #[pin_project(UnsafeUnpin)]
138 /// unsafe impl<K, V> UnsafeUnpin for Struct<K, V> where K: Unpin + Clone {}
145 pub unsafe trait UnsafeUnpin {}
162 use super::UnsafeUnpin;
192 // a regular `Unpin` impl when they specify the `UnsafeUnpin` argument.
198 // #[pin_project(UnsafeUnpin)]
203 …// impl<T> Unpin for MyStruct<T> where MyStruct<T>: UnsafeUnpin {} // generated by pin-project-int…
208 // `UnsafeUnpin`, and providing an unsound Unpin impl in safe code!
212 // the compiler will notice that `MyStruct<T>: UnsafeUnpin` never holds.
220 …// impl<T> Unpin for MyStruct<T> where Wrapper<MyStruct<T>>: UnsafeUnpin {} // generated by pin-pr…
224 // We also have `unsafe impl<T> UnsafeUnpin for Wrapper<T> where T: UnsafeUnpin {}`
229 // `Wrapper<MyStruct<T>>: UnsafeUnpin` holds, in the interest of preserving
238 // `#[pin_project(UnsafeUnpin)]`, the user must either provide no impl of
239 // `UnsafeUnpin` (which is equivalent to making the type never implement
240 // Unpin), or provide an impl of `UnsafeUnpin`. It is impossible for them to
245 unsafe impl<T: ?Sized> UnsafeUnpin for Wrapper<'_, T> where T: UnsafeUnpin {}