rust: fix doc test syntax
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Nov 2024 17:44:56 +0000 (18:44 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Dec 2024 17:49:24 +0000 (18:49 +0100)
Allow "cargo test --doc" to pass.

Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api/src/zeroable.rs

index 13cdb2ccba518429f83e9dc3271ce56b11586fca..6125aeed8b4417e5ffab02761dbbd1a7071ca77f 100644 (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