fix regression(?)

This commit is contained in:
Intege-rs
2025-07-01 14:12:21 -04:00
parent d1318f8d3a
commit 940376b258
4 changed files with 10 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ pub struct PIterMut<T>(*mut T);
impl<T: 'static> Iterator for PIter<T> { impl<T: 'static> Iterator for PIter<T> {
type Item = &'static T; type Item = &'static T;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe { unsafe {
let r = Some(&*self.0); let r = Some(&*self.0);
self.0 = self.0.offset(1isize); self.0 = self.0.offset(1isize);
@@ -27,7 +27,7 @@ impl<T: 'static> Iterator for PIter<T> {
impl<T: 'static> Iterator for PIterMut<T> { impl<T: 'static> Iterator for PIterMut<T> {
type Item = &'static mut T; type Item = &'static mut T;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe { unsafe {
let r = Some(&mut *self.0); let r = Some(&mut *self.0);
self.0 = self.0.offset(1isize); self.0 = self.0.offset(1isize);

View File

@@ -70,9 +70,11 @@ impl<T> Mut<MaybeUninit<T>> {
} }
impl<T> Deref for Mut<T> { impl<T> Deref for Mut<T> {
type Target = core::cell::UnsafeCell<T>; type Target = core::cell::UnsafeCell<T>;
#[inline(always)] #[inline(always)]
fn deref(&self) -> &Self::Target { fn deref(&self) -> &<Self as Deref>::Target {
&self.0 &self.0
} }
} }

View File

@@ -29,7 +29,7 @@ impl<T, const O: usize> Deref for VirtualOffset<T, O> {
type Target = T; type Target = T;
#[inline(always)] #[inline(always)]
fn deref(&self) -> &Self::Target { fn deref(&self) -> &<Self as Deref>::Target {
unsafe { transmute(((self as *const _ as usize) + O) as *const T)} unsafe { transmute(((self as *const _ as usize) + O) as *const T)}
} }
} }
@@ -37,7 +37,7 @@ impl<T, const O: usize> Deref for VirtualOffset<T, O> {
impl<T, const O: usize> DerefMut for VirtualOffset<T, O> { impl<T, const O: usize> DerefMut for VirtualOffset<T, O> {
#[inline(always)] #[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target { fn deref_mut(&mut self) -> &mut <Self as Deref>::Target {
unsafe { transmute(((self as *mut _ as usize) + O) as *mut T)} unsafe { transmute(((self as *mut _ as usize) + O) as *mut T)}
} }
} }
@@ -48,13 +48,13 @@ impl<T, const O: usize> DerefMut for VirtualOffset<T, O> {
impl<I, T: Index<I>, const O: usize> Index<I> for VirtualOffset<T, O> { impl<I, T: Index<I>, const O: usize> Index<I> for VirtualOffset<T, O> {
type Output = T::Output; type Output = T::Output;
fn index(&self, index: I) -> &Self::Output { fn index(&self, index: I) -> &<Self as Index<I>>::Output {
unsafe { &*self.vo_as_ptr() }.index(index) unsafe { &*self.vo_as_ptr() }.index(index)
} }
} }
impl<I, T: IndexMut<I>, const O: usize> IndexMut<I> for VirtualOffset<T, O> { impl<I, T: IndexMut<I>, const O: usize> IndexMut<I> for VirtualOffset<T, O> {
fn index_mut(&mut self, index: I) -> &mut Self::Output { fn index_mut(&mut self, index: I) -> &mut <Self as Index<I>>::Output {
unsafe { &mut *self.vo_as_ptr() }.index_mut(index) unsafe { &mut *self.vo_as_ptr() }.index_mut(index)
} }
} }

View File

@@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[features] [features]
default = ["core"] default = ["core", "xpat"]
core = ["sub_core"] core = ["sub_core"]
macros = ["sub_macros"] macros = ["sub_macros"]
libm = ["sub_libm"] libm = ["sub_libm"]