@@ -70,7 +70,7 @@ impl Storages {
70
70
let ( components, table_row) =
71
71
fetch_table ( archetypes, self , location, component_id) ?;
72
72
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
74
74
Some ( (
75
75
components. get_data_unchecked ( table_row) ,
76
76
TickCells {
@@ -129,7 +129,7 @@ impl Storages {
129
129
StorageType :: Table => {
130
130
let ( components, table_row) =
131
131
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
133
133
Some ( components. get_data_unchecked ( table_row) )
134
134
}
135
135
StorageType :: SparseSet => fetch_sparse_set ( self , component_id) ?. get ( entity) ,
@@ -181,7 +181,7 @@ impl Storages {
181
181
StorageType :: Table => {
182
182
let ( components, table_row) =
183
183
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
185
185
Some ( components. get_ticks_unchecked ( table_row) )
186
186
}
187
187
StorageType :: SparseSet => fetch_sparse_set ( self , component_id) ?. get_ticks ( entity) ,
@@ -220,8 +220,8 @@ impl Storages {
220
220
let table = & mut self . tables [ archetype. table_id ( ) ] ;
221
221
// SAFETY: archetypes will always point to valid columns
222
222
let components = table. get_column_mut ( component_id) . unwrap ( ) ;
223
+ // SAFETY: archetypes only store valid table_rows
223
224
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
225
225
// SAFETY: promote is safe because the caller promises to remove the table row without dropping it immediately afterwards
226
226
components. get_data_unchecked_mut ( table_row) . promote ( )
227
227
}
0 commit comments