Skip to content

Commit 2eb4f7d

Browse files
fix[ffi]: to and from ffi types should have a fully defined cast (#7261)
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 37b7625 commit 2eb4f7d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vortex-ffi/src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ macro_rules! arc_wrapper {
119119
impl $ffi_ident {
120120
/// Wrap an owned object into a raw pointer.
121121
pub(crate) fn new(obj: std::sync::Arc<$T>) -> *const $ffi_ident {
122-
std::sync::Arc::into_raw(obj).cast()
122+
std::sync::Arc::into_raw(obj).cast::<$ffi_ident>()
123123
}
124124

125125
/// Wrap a borrowed object into a raw pointer.
@@ -246,7 +246,7 @@ macro_rules! box_wrapper {
246246
impl $ffi_ident {
247247
/// Wrap an owned object into a raw pointer.
248248
pub(crate) fn new(obj: Box<$T>) -> *mut $ffi_ident {
249-
Box::into_raw(obj).cast()
249+
Box::into_raw(obj).cast::<$ffi_ident>()
250250
}
251251

252252
/// Wrap a borrowed object into a raw pointer.

0 commit comments

Comments
 (0)