diff --git a/rust/kernel/alloc/kbox.rs b/rust/kernel/alloc/kbox.rs index 31b2588ed5bf..80eb39364e86 100644 --- a/rust/kernel/alloc/kbox.rs +++ b/rust/kernel/alloc/kbox.rs @@ -437,6 +437,7 @@ impl InPlaceWrite for Box, A> { type Initialized = Box; + #[inline] fn write_init(mut self, init: impl Init) -> Result { let slot = self.as_mut_ptr(); // SAFETY: When init errors/panics, slot will get deallocated but not dropped, @@ -446,6 +447,7 @@ fn write_init(mut self, init: impl Init) -> Result(mut self, init: impl PinInit) -> Result, E> { let slot = self.as_mut_ptr(); // SAFETY: When init errors/panics, slot will get deallocated but not dropped, diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs index 7a0d4559d7b5..05a12e869a57 100644 --- a/rust/kernel/init.rs +++ b/rust/kernel/init.rs @@ -151,6 +151,7 @@ fn try_pin_init(init: impl PinInit, flags: Flags) -> Result(init: impl PinInit, flags: Flags) -> error::Result where Error: From, @@ -168,6 +169,7 @@ fn try_init(init: impl Init, flags: Flags) -> Result E: From; /// Use the given initializer to in-place initialize a `T`. + #[inline] fn init(init: impl Init, flags: Flags) -> error::Result where Error: From, diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 18d6c0d62ce0..feca07e8d13d 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -712,6 +712,7 @@ fn try_init(init: impl Init, flags: Flags) -> Result impl InPlaceWrite for UniqueArc> { type Initialized = UniqueArc; + #[inline] fn write_init(mut self, init: impl Init) -> Result { let slot = self.as_mut_ptr(); // SAFETY: When init errors/panics, slot will get deallocated but not dropped, @@ -721,6 +722,7 @@ fn write_init(mut self, init: impl Init) -> Result(mut self, init: impl PinInit) -> Result, E> { let slot = self.as_mut_ptr(); // SAFETY: When init errors/panics, slot will get deallocated but not dropped, @@ -782,6 +784,7 @@ pub unsafe fn assume_init(self) -> UniqueArc { } /// Initialize `self` using the given initializer. + #[inline] pub fn init_with(mut self, init: impl Init) -> core::result::Result, E> { // SAFETY: The supplied pointer is valid for initialization. match unsafe { init.__init(self.as_mut_ptr()) } { @@ -792,6 +795,7 @@ pub fn init_with(mut self, init: impl Init) -> core::result::Result( mut self, init: impl PinInit,