Skip to content

Commit 47561a4

Browse files
Make things compatible with branch
1 parent 028e3fa commit 47561a4

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

crates/bevy_ecs/src/ptr.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ macro_rules! impl_ptr {
9999

100100
impl_ptr!(Ptr);
101101
impl<'a> Ptr<'a> {
102+
pub fn inner(self) -> NonNull<u8> {
103+
self.0
104+
}
105+
102106
/// # Safety
103107
/// another PtrMut for the same Ptr shouldn't be created until the first is dropped.
104108
pub unsafe fn assert_unique(self) -> PtrMut<'a> {

crates/bevy_ecs/src/query/fetch.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for ReadFetch<T> {
336336
let column = tables[archetype.table_id()]
337337
.get_column(state.component_id)
338338
.unwrap();
339-
self.table_components = column.get_data_ptr().inner_nonnull().cast::<T>();
339+
self.table_components = column.get_data_ptr().inner().cast::<T>();
340340
}
341341
StorageType::SparseSet => self.entities = archetype.entities().as_ptr(),
342342
}
@@ -348,7 +348,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for ReadFetch<T> {
348348
.get_column(state.component_id)
349349
.unwrap()
350350
.get_data_ptr()
351-
.inner_nonnull()
351+
.inner()
352352
.cast::<T>();
353353
}
354354

@@ -364,7 +364,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for ReadFetch<T> {
364364
&*(*self.sparse_set)
365365
.get(entity)
366366
.unwrap()
367-
.inner_nonnull()
367+
.inner()
368368
.cast::<T>()
369369
.as_ptr()
370370
}
@@ -502,7 +502,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for WriteFetch<T> {
502502
let column = tables[archetype.table_id()]
503503
.get_column(state.component_id)
504504
.unwrap();
505-
self.table_components = column.get_data_ptr().inner_nonnull().cast::<T>();
505+
self.table_components = column.get_data_ptr().inner().cast::<T>();
506506
self.table_ticks = column.get_ticks_ptr();
507507
}
508508
StorageType::SparseSet => self.entities = archetype.entities().as_ptr(),
@@ -512,7 +512,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for WriteFetch<T> {
512512
#[inline]
513513
unsafe fn set_table(&mut self, state: &Self::State, table: &Table) {
514514
let column = table.get_column(state.component_id).unwrap();
515-
self.table_components = column.get_data_ptr().inner_nonnull().cast::<T>();
515+
self.table_components = column.get_data_ptr().inner().cast::<T>();
516516
self.table_ticks = column.get_ticks_ptr();
517517
}
518518

@@ -535,7 +535,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for WriteFetch<T> {
535535
let (component, component_ticks) =
536536
(*self.sparse_set).get_with_ticks(entity).unwrap();
537537
Mut {
538-
value: &mut *component.inner_nonnull().cast::<T>().as_ptr(),
538+
value: &mut *component.inner().cast::<T>().as_ptr(),
539539
ticks: Ticks {
540540
component_ticks: &mut *component_ticks.get(),
541541
change_tick: self.change_tick,
@@ -862,7 +862,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for ChangeTrackersFetch<T> {
862862
let column = tables[archetype.table_id()]
863863
.get_column(state.component_id)
864864
.unwrap();
865-
self.table_ticks = column.get_ticks_const_ptr();
865+
self.table_ticks = column.get_ticks_ptr() as *const _;
866866
}
867867
StorageType::SparseSet => self.entities = archetype.entities().as_ptr(),
868868
}
@@ -873,7 +873,7 @@ impl<'w, 's, T: Component> Fetch<'w, 's> for ChangeTrackersFetch<T> {
873873
self.table_ticks = table
874874
.get_column(state.component_id)
875875
.unwrap()
876-
.get_ticks_const_ptr();
876+
.get_ticks_ptr() as *const _;
877877
}
878878

879879
#[inline]

0 commit comments

Comments
 (0)