We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Box::into_pin
1 parent 042b0c7 commit b4fecceCopy full SHA for b4fecce
rust/kernel/alloc/kbox.rs
@@ -245,6 +245,12 @@ where
245
Ok(Self::new(x, flags)?.into())
246
}
247
248
+ /// Convert a [`Box<T,A>`] to a [`Pin<Box<T,A>>`]. If `T` does not implement
249
+ /// [`Unpin`], then `x` will be pinned in memory and can't be moved.
250
+ pub fn into_pin(this: Self) -> Pin<Self> {
251
+ this.into()
252
+ }
253
+
254
/// Forgets the contents (does not run the destructor), but keeps the allocation.
255
fn forget_contents(this: Self) -> Box<MaybeUninit<T>, A> {
256
let ptr = Self::into_raw(this);
0 commit comments