From 8004044789491d708064626424eb36fd42a7c461 Mon Sep 17 00:00:00 2001 From: numzero Date: Thu, 7 May 2026 20:59:14 +0300 Subject: [PATCH] make OwnRef covariant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit while it references the memory the value itself is owned, so that’s the right thing --- src/ptr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ptr.rs b/src/ptr.rs index 4633274..ad66d9b 100644 --- a/src/ptr.rs +++ b/src/ptr.rs @@ -5,7 +5,7 @@ use std::{ ptr::NonNull, }; -pub struct OwnRef<'a, T: ?Sized>(Option>, PhantomData<&'a mut T>); +pub struct OwnRef<'a, T: ?Sized>(Option>, PhantomData<(&'a mut [u8], T)>); impl Drop for OwnRef<'_, T> { fn drop(&mut self) {