]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: do not use MaybeUninit::zeroed()
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Oct 2024 09:53:19 +0000 (11:53 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Nov 2024 13:18:17 +0000 (14:18 +0100)
commitbb42965dd417042d171ecf98cb470c430b592134
treec847d5c8247f66c37be5e9a2f3fdabe50e354b85
parentf3518400882022ddcbe1148abf2165917a7b4640
rust: do not use MaybeUninit::zeroed()

MaybeUninit::zeroed() is handy but is not available as a "const" function
until Rust 1.75.0.

Remove the default implementation of Zeroable::ZERO, and write by hand
the definitions for those types that need it.  It may be possible to
add automatic implementation of the trait, via a procedural macro and/or
a trick similar to offset_of!, but do it the easy way for now.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api/src/zeroable.rs