make OwnRef covariant

while it references the memory the value itself is owned, so that’s the right thing
This commit is contained in:
numzero 2026-05-07 20:59:14 +03:00
parent fc57085534
commit 8004044789

View File

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