[PATCH v2 2/7] pin_init: always inline the #ident and #project_ident methods
From: Alexandre Courbot
Date: Wed May 27 2026 - 07:54:39 EST
These methods should always be inlined for optimization reasons. Failure
to do so can also produce symbol names larger than what `modpost`
supports.
Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
---
rust/pin-init/internal/src/pin_data.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rust/pin-init/internal/src/pin_data.rs b/rust/pin-init/internal/src/pin_data.rs
index 7d871236b49c..945254740f61 100644
--- a/rust/pin-init/internal/src/pin_data.rs
+++ b/rust/pin-init/internal/src/pin_data.rs
@@ -395,6 +395,7 @@ fn handle_field(
/// to deallocate.
#pin_safety
#(#attrs)*
+ #[inline(always)]
#vis unsafe fn #ident<E>(
self,
slot: *mut #ty,
@@ -409,6 +410,7 @@ fn handle_field(
///
#[doc = #slot_safety]
#(#attrs)*
+ #[inline(always)]
#vis unsafe fn #project_ident<'__slot>(
self,
slot: &'__slot mut #ty,
--
2.54.0