qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 12/13] rust: provide safe wrapper for MaybeUninit::zeroed()


From: Junjie Mao
Subject: Re: [PATCH 12/13] rust: provide safe wrapper for MaybeUninit::zeroed()
Date: Mon, 21 Oct 2024 19:46:04 +0800
User-agent: mu4e 1.6.10; emacs 27.1

Paolo Bonzini <pbonzini@redhat.com> writes:

> MaybeUninit::zeroed() is handy, but it introduces unsafe (and has a
> pretty heavy syntax in general).  Introduce a trait that provides the
> same functionality while staying within safe Rust.
>
> In addition, MaybeUninit::zeroed() is not available as a "const"
> function until Rust 1.75.0, so this also prepares for having handwritten
> implementations of the trait until we can assume that version.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>

--
Best Regards
Junjie Mao



reply via email to

[Prev in Thread] Current Thread [Next in Thread]