diff mbox series

[RFC,10/11] rust: fix doc test syntax

Message ID 20241108180139.117112-11-pbonzini@redhat.com (mailing list archive)
State New
Headers show
Series rust: improved integration with cargo | expand

Commit Message

Paolo Bonzini Nov. 8, 2024, 6:01 p.m. UTC
Allow "cargo test --doc" to pass.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/qemu-api/src/zeroable.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Junjie Mao Nov. 13, 2024, 7:22 a.m. UTC | #1
Paolo Bonzini <pbonzini@redhat.com> writes:

> Allow "cargo test --doc" to pass.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

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

--
Best Regards
Junjie Mao
diff mbox series

Patch

diff --git a/rust/qemu-api/src/zeroable.rs b/rust/qemu-api/src/zeroable.rs
index 13cdb2ccba5..6125aeed8b4 100644
--- a/rust/qemu-api/src/zeroable.rs
+++ b/rust/qemu-api/src/zeroable.rs
@@ -7,9 +7,9 @@ 
 /// 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