diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-11 13:55:53 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-13 13:50:43 +0100 |
commit | 16534af51bc0e9c3db94097ab37ebd3ed50e1c0f (patch) | |
tree | 0737cf6d26f386c251bc2debcf6bd20272356b32 | |
parent | ee7d3aec54a32ce53c9b5ca86c75c945a877db19 (diff) | |
download | qemu-16534af51bc0e9c3db94097ab37ebd3ed50e1c0f.zip qemu-16534af51bc0e9c3db94097ab37ebd3ed50e1c0f.tar.gz qemu-16534af51bc0e9c3db94097ab37ebd3ed50e1c0f.tar.bz2 |
rust: fix doctests
Doctests were not being run by CI, and have broken. Fix them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | .gitlab-ci.d/buildtest.yml | 6 | ||||
-rw-r--r-- | rust/qemu-api/src/vmstate.rs | 2 | ||||
-rw-r--r-- | rust/qemu-api/src/zeroable.rs | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 4265a57..00f4bfc 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -131,6 +131,12 @@ build-system-fedora-rust-nightly: CONFIGURE_ARGS: --disable-docs --enable-rust --enable-strict-rust-lints TARGETS: aarch64-softmmu MAKE_CHECK_ARGS: check-build + after_script: + - source scripts/ci/gitlab-ci-section + - section_start test "Running Rust doctests" + - cd build + - pyvenv/bin/meson devenv -w ../rust ${CARGO-cargo} test --doc -p qemu_api + allow_failure: true check-system-fedora: diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs index c6dfb60..24a4dc8 100644 --- a/rust/qemu-api/src/vmstate.rs +++ b/rust/qemu-api/src/vmstate.rs @@ -294,7 +294,7 @@ impl VMStateField { /// # Examples /// /// ``` -/// # use qemu_api::vmstate::impl_vmstate_forward; +/// # use qemu_api::impl_vmstate_forward; /// pub struct Fifo([u8; 16]); /// impl_vmstate_forward!(Fifo); /// ``` diff --git a/rust/qemu-api/src/zeroable.rs b/rust/qemu-api/src/zeroable.rs index a2356cb..47b6977 100644 --- a/rust/qemu-api/src/zeroable.rs +++ b/rust/qemu-api/src/zeroable.rs @@ -7,7 +7,7 @@ /// behavior. This trait in principle could be implemented as just: /// /// ``` -/// pub unsafe trait Zeroable { +/// pub unsafe trait Zeroable: Default { /// const ZERO: Self = unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() }; /// } /// ``` |