Send+Sync
This commit is contained in:
parent
81ee71f73a
commit
57de8c826d
|
|
@ -9,6 +9,9 @@ use std::{
|
||||||
#[repr(transparent)]
|
#[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)>);
|
||||||
|
|
||||||
|
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> {
|
impl<T: ?Sized> Drop for OwnRef<'_, T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let Some(p) = self.0 else { return };
|
let Some(p) = self.0 else { return };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user