Re: [PATCH RESEND v13 1/2] rust: fmt: fix {:p} printing stack addresses
"Gary Guo" <[email protected]>
| Newsgroups | org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Mon Jul 6, 2026 at 6:18 AM BST, Ke Sun wrote:
> The `impl_fmt_adapter_forward!` macro forwards `Pointer` for
> `Adapter<T>` by destructuring `self` into a local `t`, causing `{:p}`
> to print the address of that temporary stack variable rather than the
> actual pointer.
>
> Remove `Pointer` from the macro and provide a manual impl for
> `Adapter<&T>` that passes `self.0` directly.
>
> Signed-off-by: Ke Sun <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
> ---
> rust/kernel/fmt.rs | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)