@@ -211,7 +211,7 @@
//! [`pin_init!`]: crate::pin_init!
use crate::{
- alloc::{AllocError, Allocator, Flags, KBox},
+ alloc::{AllocError, Allocator, Box, Flags, KBox},
error::{self, Error},
sync::UniqueArc,
types::{Opaque, ScopeGuard},
@@ -1147,7 +1147,7 @@ fn init<E>(init: impl Init<T, E>, flags: Flags) -> error::Result<Self>
}
}
-impl<T, A> InPlaceInit<T> for crate::alloc::Box<T, A>
+impl<T, A> InPlaceInit<T> for Box<T, A>
where
A: Allocator + 'static,
{
@@ -1156,13 +1156,13 @@ fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>,
where
E: From<AllocError>,
{
- let mut this = crate::alloc::Box::<_, A>::new_uninit(flags)?;
+ let mut this = Box::<_, A>::new_uninit(flags)?;
let slot = this.as_mut_ptr();
// SAFETY: When init errors/panics, slot will get deallocated but not dropped,
// slot is valid and will not be moved, because we pin it later.
unsafe { init.__pinned_init(slot)? };
// SAFETY: All fields have been initialized.
- Ok(unsafe { crate::alloc::Box::assume_init(this) }.into())
+ Ok(unsafe { Box::assume_init(this) }.into())
}
#[inline]
@@ -1170,13 +1170,13 @@ fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E>
where
E: From<AllocError>,
{
- let mut this = crate::alloc::Box::<_, A>::new_uninit(flags)?;
+ let mut this = Box::<_, A>::new_uninit(flags)?;
let slot = this.as_mut_ptr();
// SAFETY: When init errors/panics, slot will get deallocated but not dropped,
// slot is valid.
unsafe { init.__init(slot)? };
// SAFETY: All fields have been initialized.
- Ok(unsafe { crate::alloc::Box::assume_init(this) })
+ Ok(unsafe { Box::assume_init(this) })
}
}
Now that we removed `BoxExt` and the corresponding includes in init.rs, add the new kernel `Box` type instead. Signed-off-by: Danilo Krummrich <dakr@kernel.org> --- rust/kernel/init.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)