[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
- Re: [PATCH 08/13] rust: build integration test for the qemu_api crate, (continued)
- [PATCH 10/13] qdev: make properties array "const", Paolo Bonzini, 2024/10/18
- [PATCH 11/13] rust: make properties array immutable, Paolo Bonzini, 2024/10/18
- [PATCH 12/13] rust: provide safe wrapper for MaybeUninit::zeroed(), Paolo Bonzini, 2024/10/18
- Re: [PATCH 12/13] rust: provide safe wrapper for MaybeUninit::zeroed(),
Junjie Mao <=
- [PATCH 13/13] rust: do not use TYPE_CHARDEV unnecessarily, Paolo Bonzini, 2024/10/18