From 940376b258a4d3ee770809933f13fabe6cf9473d Mon Sep 17 00:00:00 2001 From: Intege-rs Date: Tue, 1 Jul 2025 14:12:21 -0400 Subject: [PATCH] fix regression(?) --- sub/core/src/ext/ptr.rs | 4 ++-- sub/core/src/pod.rs | 4 +++- sub/core/src/pstruct.rs | 8 ++++---- x/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sub/core/src/ext/ptr.rs b/sub/core/src/ext/ptr.rs index a9eeef2..3a28d69 100644 --- a/sub/core/src/ext/ptr.rs +++ b/sub/core/src/ext/ptr.rs @@ -16,7 +16,7 @@ pub struct PIterMut(*mut T); impl Iterator for PIter { type Item = &'static T; - fn next(&mut self) -> Option { + fn next(&mut self) -> Option<::Item> { unsafe { let r = Some(&*self.0); self.0 = self.0.offset(1isize); @@ -27,7 +27,7 @@ impl Iterator for PIter { impl Iterator for PIterMut { type Item = &'static mut T; - fn next(&mut self) -> Option { + fn next(&mut self) -> Option<::Item> { unsafe { let r = Some(&mut *self.0); self.0 = self.0.offset(1isize); diff --git a/sub/core/src/pod.rs b/sub/core/src/pod.rs index 92e0baa..c3f48e9 100644 --- a/sub/core/src/pod.rs +++ b/sub/core/src/pod.rs @@ -70,9 +70,11 @@ impl Mut> { } impl Deref for Mut { + type Target = core::cell::UnsafeCell; + #[inline(always)] - fn deref(&self) -> &Self::Target { + fn deref(&self) -> &::Target { &self.0 } } \ No newline at end of file diff --git a/sub/core/src/pstruct.rs b/sub/core/src/pstruct.rs index 5ec6d32..94a3c25 100644 --- a/sub/core/src/pstruct.rs +++ b/sub/core/src/pstruct.rs @@ -29,7 +29,7 @@ impl Deref for VirtualOffset { type Target = T; #[inline(always)] - fn deref(&self) -> &Self::Target { + fn deref(&self) -> &::Target { unsafe { transmute(((self as *const _ as usize) + O) as *const T)} } } @@ -37,7 +37,7 @@ impl Deref for VirtualOffset { impl DerefMut for VirtualOffset { #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { + fn deref_mut(&mut self) -> &mut ::Target { unsafe { transmute(((self as *mut _ as usize) + O) as *mut T)} } } @@ -48,13 +48,13 @@ impl DerefMut for VirtualOffset { impl, const O: usize> Index for VirtualOffset { type Output = T::Output; - fn index(&self, index: I) -> &Self::Output { + fn index(&self, index: I) -> &>::Output { unsafe { &*self.vo_as_ptr() }.index(index) } } impl, const O: usize> IndexMut for VirtualOffset { - fn index_mut(&mut self, index: I) -> &mut Self::Output { + fn index_mut(&mut self, index: I) -> &mut >::Output { unsafe { &mut *self.vo_as_ptr() }.index_mut(index) } } diff --git a/x/Cargo.toml b/x/Cargo.toml index 5806b45..01b5ce9 100644 --- a/x/Cargo.toml +++ b/x/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [features] -default = ["core"] +default = ["core", "xpat"] core = ["sub_core"] macros = ["sub_macros"] libm = ["sub_libm"]