Re: [PATCH v2 2/7] pin_init: always inline the #ident and #project_ident methods

From: Gary Guo

Date: Wed May 27 2026 - 13:49:38 EST


On Wed May 27, 2026 at 12:52 PM BST, Alexandre Courbot wrote:
> 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,

This code doesn't exist anymore on pin-init-next.

Best,
Gary