]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
rust: re-export qemu_macros internal helper in "bits"
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 8 Sep 2025 10:50:01 +0000 (12:50 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Sep 2025 17:00:57 +0000 (19:00 +0200)
Avoid the need to import "qemu_macros".

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20250827104147.717203-21-marcandre.lureau@redhat.com
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/bits/src/lib.rs

index 1bc882fde18657c26c97d6a495c1f9623659be0f..d1141f7c882a3e91ca2ac384804a73b3248608b7 100644 (file)
@@ -380,14 +380,17 @@ macro_rules! bits {
     };
 
     { $type:ty: $expr:expr } => {
-        ::qemu_macros::bits_const_internal! { $type @ ($expr) }
+        $crate::bits_const_internal! { $type @ ($expr) }
     };
 
     { $type:ty as $int_type:ty: $expr:expr } => {
-        (::qemu_macros::bits_const_internal! { $type @ ($expr) }.into_bits()) as $int_type
+        ($crate::bits_const_internal! { $type @ ($expr) }.into_bits()) as $int_type
     };
 }
 
+#[doc(hidden)]
+pub use qemu_macros::bits_const_internal;
+
 #[cfg(test)]
 mod test {
     bits! {