Re: [PATCH v2 3/5] rust: pin-init: add `ptr_init` and `ptr_try_init` and recommend over `__init`

From: Gary Guo

Date: Wed Aug 05 2026 - 06:57:03 EST


On Wed Aug 5, 2026 at 11:22 AM BST, Benno Lossin wrote:
> On Wed Jul 29, 2026 at 5:38 PM CEST, Gary Guo wrote:
>> The `__init` method is not designed to be a public API (existence of "__"
>> is a hint for this); but currently there is no other API that allows raw
>> initialization on pointers. Add `ptr_init` and `ptr_try_init` and recommend
>> people to use this instead if raw pointer initialization is needed.
>
> How about we call these two functions `raw_init` and `raw_try_init`
> respectively? I feel like that conveys the meaning of what they are
> doing much better.
>
> With that: Reviewed-by: Benno Lossin <lossin@xxxxxxxxxx>

Hmm, I agree that these names are better.

Given that I've picked these to pin-init-next already, I've amended the tree.
Could you check the changes I made there?

Best,
Gary

>
> Cheers,
> Benno
>
>> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
>> ---
>> rust/pin-init/examples/static_init.rs | 5 +++--
>> rust/pin-init/src/lib.rs | 32 +++++++++++++++++++++++++++++++-
>> 2 files changed, 34 insertions(+), 3 deletions(-)