From ba8e64cc6efe38b5f967cb7f8240ea1ebfdd4470 Mon Sep 17 00:00:00 2001
From: David Li
Date: Mon, 12 May 2025 13:26:53 +0900
Subject: [PATCH] fix(rust/core): use $crate so driver export works outside
crate
---
rust/core/src/driver_exporter.rs | 4 ++--
rust/core/src/ffi/methods.rs | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/rust/core/src/driver_exporter.rs b/rust/core/src/driver_exporter.rs
index 9c7531509d..dd10a8fa06 100644
--- a/rust/core/src/driver_exporter.rs
+++ b/rust/core/src/driver_exporter.rs
@@ -247,9 +247,9 @@ macro_rules! check_err {
macro_rules! check_not_null {
($ptr:ident, $err_out:expr) => {
let res = if $ptr.is_null() {
- Err(Error::with_message_and_status(
+ Err($crate::error::Error::with_message_and_status(
format!("Passed null pointer for argument {:?}", stringify!($ptr)),
- Status::InvalidArguments,
+ $crate::error::Status::InvalidArguments,
))
} else {
Ok(())
diff --git a/rust/core/src/ffi/methods.rs b/rust/core/src/ffi/methods.rs
index 0b065c3bee..e4be57965b 100644
--- a/rust/core/src/ffi/methods.rs
+++ b/rust/core/src/ffi/methods.rs
@@ -29,7 +29,9 @@ use super::{
macro_rules! method {
($func_name:ident ; $type_name:ident ; $return_type:ty ; $return_value:expr ; $( $arg:ty ),*) => {
+ #[allow(dead_code)]
pub(crate) type $type_name = unsafe extern "C" fn($( $arg ),*) -> $return_type;
+ #[allow(dead_code)]
pub(crate) unsafe extern "C" fn $func_name($(_:$arg),*) -> $return_type {
$return_value
}