Skip to content

Commit 2f06ee1

Browse files
remove comments referring to type when untyped pointer is returned
1 parent 37223f2 commit 2f06ee1

File tree

1 file changed

+4
-4
lines changed
  • crates/bevy_ecs/src/storage

1 file changed

+4
-4
lines changed

crates/bevy_ecs/src/storage/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl Storages {
7070
let (components, table_row) =
7171
fetch_table(archetypes, self, location, component_id)?;
7272

73-
// SAFETY: archetypes only store valid table_rows and the stored component type is T
73+
// SAFETY: archetypes only store valid table_rows and caller ensure aliasing rules
7474
Some((
7575
components.get_data_unchecked(table_row),
7676
TickCells {
@@ -129,7 +129,7 @@ impl Storages {
129129
StorageType::Table => {
130130
let (components, table_row) =
131131
fetch_table(archetypes, self, location, component_id)?;
132-
// SAFETY: archetypes only store valid table_rows and the stored component type is T
132+
// SAFETY: archetypes only store valid table_rows and caller ensure aliasing rules
133133
Some(components.get_data_unchecked(table_row))
134134
}
135135
StorageType::SparseSet => fetch_sparse_set(self, component_id)?.get(entity),
@@ -181,7 +181,7 @@ impl Storages {
181181
StorageType::Table => {
182182
let (components, table_row) =
183183
fetch_table(archetypes, self, location, component_id)?;
184-
// SAFETY: archetypes only store valid table_rows and the stored component type is T
184+
// SAFETY: archetypes only store valid table_rows and caller ensure aliasing rules
185185
Some(components.get_ticks_unchecked(table_row))
186186
}
187187
StorageType::SparseSet => fetch_sparse_set(self, component_id)?.get_ticks(entity),
@@ -220,8 +220,8 @@ impl Storages {
220220
let table = &mut self.tables[archetype.table_id()];
221221
// SAFETY: archetypes will always point to valid columns
222222
let components = table.get_column_mut(component_id).unwrap();
223+
// SAFETY: archetypes only store valid table_rows
223224
let table_row = archetype.entity_table_row(location.archetype_row);
224-
// SAFETY: archetypes only store valid table_rows and the stored component type is T
225225
// SAFETY: promote is safe because the caller promises to remove the table row without dropping it immediately afterwards
226226
components.get_data_unchecked_mut(table_row).promote()
227227
}

0 commit comments

Comments
 (0)