Send+Sync

This commit is contained in:
numzero 2026-05-07 21:51:40 +03:00
parent 81ee71f73a
commit 57de8c826d

View File

@ -9,6 +9,9 @@ use std::{
#[repr(transparent)]
pub struct OwnRef<'a, T: ?Sized>(Option<NonNull<T>>, PhantomData<(&'a mut [u8], T)>);
unsafe impl<T: ?Sized + Send> Send for OwnRef<'_, T> {}
unsafe impl<T: ?Sized + Sync> Sync for OwnRef<'_, T> {}
impl<T: ?Sized> Drop for OwnRef<'_, T> {
fn drop(&mut self) {
let Some(p) = self.0 else { return };