Re: [PATCH v2 3/5] rust: pin-init: add `ptr_init` and `ptr_try_init` and recommend over `__init`
From: Benno Lossin
Date: Wed Aug 05 2026 - 06:23:13 EST
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>
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(-)