summary refs log tree commit diff stats
path: root/rust/common
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2025-09-08 12:50:02 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-09-17 19:00:58 +0200
commite4444d71e85b5f5ea8311eb59fea3e52f5fc5a14 (patch)
tree8f955e1324f0b039540c368db3537f10dcd8796a /rust/common
parentb0f6bf8a5b3b3a9dd4a11f792084d39a76b4b007 (diff)
downloadfocaccia-qemu-e4444d71e85b5f5ea8311eb59fea3e52f5fc5a14.tar.gz
focaccia-qemu-e4444d71e85b5f5ea8311eb59fea3e52f5fc5a14.zip
rust: re-export qemu macros from common/qom/hwcore
This is just a bit nicer.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20250827104147.717203-22-marcandre.lureau@redhat.com
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/common')
-rw-r--r--rust/common/Cargo.toml1
-rw-r--r--rust/common/meson.build2
-rw-r--r--rust/common/src/lib.rs2
-rw-r--r--rust/common/src/opaque.rs4
4 files changed, 5 insertions, 4 deletions
diff --git a/rust/common/Cargo.toml b/rust/common/Cargo.toml
index 5e106427e8..0e1b4fc505 100644
--- a/rust/common/Cargo.toml
+++ b/rust/common/Cargo.toml
@@ -14,6 +14,7 @@ rust-version.workspace = true
 
 [dependencies]
 libc.workspace = true
+qemu_macros = { path = "../qemu-macros" }
 
 [lints]
 workspace = true
diff --git a/rust/common/meson.build b/rust/common/meson.build
index 230a967760..b805e0faf5 100644
--- a/rust/common/meson.build
+++ b/rust/common/meson.build
@@ -19,7 +19,7 @@ _common_rs = static_library(
   override_options: ['rust_std=2021', 'build.rust_std=2021'],
   rust_abi: 'rust',
   rust_args: _common_cfg,
-  dependencies: [libc_rs],
+  dependencies: [libc_rs, qemu_macros],
 )
 
 common_rs = declare_dependency(link_with: [_common_rs])
diff --git a/rust/common/src/lib.rs b/rust/common/src/lib.rs
index 25216503aa..8311bf945d 100644
--- a/rust/common/src/lib.rs
+++ b/rust/common/src/lib.rs
@@ -1,5 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
+pub use qemu_macros::{TryInto, Wrapper};
+
 pub mod assertions;
 
 pub mod bitops;
diff --git a/rust/common/src/opaque.rs b/rust/common/src/opaque.rs
index 3b3263acaa..c941fb4546 100644
--- a/rust/common/src/opaque.rs
+++ b/rust/common/src/opaque.rs
@@ -192,7 +192,7 @@ impl<T: Default> Opaque<T> {
 
 /// Annotates [`Self`] as a transparent wrapper for another type.
 ///
-/// Usually defined via the [`qemu_macros::Wrapper`] derive macro.
+/// Usually defined via the [`crate::Wrapper`] derive macro.
 ///
 /// # Examples
 ///
@@ -227,8 +227,6 @@ impl<T: Default> Opaque<T> {
 /// ```
 ///
 /// They are not defined here to allow them to be `const`.
-///
-/// [`qemu_macros::Wrapper`]: ../../qemu_macros/derive.Wrapper.html
 pub unsafe trait Wrapper {
     type Wrapped;
 }