repr(transparent)

it could be useful in FFI
This commit is contained in:
numzero 2026-05-07 21:04:05 +03:00
parent 8004044789
commit f94950afb9

View File

@ -5,6 +5,7 @@ use std::{
ptr::NonNull, ptr::NonNull,
}; };
#[repr(transparent)]
pub struct OwnRef<'a, T: ?Sized>(Option<NonNull<T>>, PhantomData<(&'a mut [u8], T)>); pub struct OwnRef<'a, T: ?Sized>(Option<NonNull<T>>, PhantomData<(&'a mut [u8], T)>);
impl<T: ?Sized> Drop for OwnRef<'_, T> { impl<T: ?Sized> Drop for OwnRef<'_, T> {