From 4344b358a8dd62591db0b7b98328511fadffca85 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Mon, 28 Jul 2025 14:48:23 +0300 Subject: rust: declare self as qemu_api for proc-macros Fix an outstanding TODO. Declaring `extern crate self as qemu_api` allows use of `qemu_api` within the qemu_api crate; this allows the Wrapper derive macro and future proc macros to be used interchangeably in the qemu_api crate and other crates. This is not required currently and is only for future-proofing. Signed-off-by: Manos Pitsidianakis Link: https://lore.kernel.org/r/20250728-self-as-qemu_api-v1-1-001c339cccc8@linaro.org Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rust/qemu-api') diff --git a/rust/qemu-api/src/lib.rs b/rust/qemu-api/src/lib.rs index 86dcd8e..bcb51c7 100644 --- a/rust/qemu-api/src/lib.rs +++ b/rust/qemu-api/src/lib.rs @@ -32,6 +32,10 @@ pub mod uninit; pub mod vmstate; pub mod zeroable; +// Allow proc-macros to refer to `::qemu_api` inside the `qemu_api` crate (this +// crate). +extern crate self as qemu_api; + use std::{ alloc::{GlobalAlloc, Layout}, ffi::c_void, -- cgit v1.1 From 92dedaf169ddcf8c81fa6d21c86c60f3b82458e5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 22 Aug 2025 12:07:44 +0200 Subject: rust: move dependencies to rust/Cargo.toml As more crates start using the same dependencies, it's better to not repeat the versions and move the dependency declarations to the workspace. Reviewed-by: Manos Pitsidianakis Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/qemu-api/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rust/qemu-api') diff --git a/rust/qemu-api/Cargo.toml b/rust/qemu-api/Cargo.toml index db7000d..c07a17a 100644 --- a/rust/qemu-api/Cargo.toml +++ b/rust/qemu-api/Cargo.toml @@ -15,9 +15,9 @@ rust-version.workspace = true [dependencies] qemu_api_macros = { path = "../qemu-api-macros" } -anyhow = "~1.0" -libc = "0.2.162" -foreign = "~0.3.1" +anyhow = { workspace = true } +foreign = { workspace = true } +libc = { workspace = true } [features] default = ["debug_cell"] -- cgit v1.1