rust: fix doc test syntax

Allow "cargo test --doc" to pass.

Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-11-05 18:44:56 +01:00
parent 4e0a11d12f
commit 8a88b55f69

View file

@ -7,9 +7,9 @@ use std::ptr;
/// behavior. This trait in principle could be implemented as just:
///
/// ```
/// const ZERO: Self = unsafe {
/// ::core::mem::MaybeUninit::<$crate::bindings::Property>::zeroed().assume_init()
/// },
/// pub unsafe trait Zeroable: Default {
/// const ZERO: Self = unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() };
/// }
/// ```
///
/// The need for a manual implementation is only because `zeroed()` cannot