@@ -818,24 +818,35 @@ unsafe fn get_ticks(
818
818
}
819
819
820
820
#[ inline]
821
- #[ allow( unsafe_op_in_unsafe_fn) ]
821
+ /// # Safety:
822
+ /// - the returned `Column` is only used in ways that the `world` has permission for.
823
+ /// - the returned `Column` is only used in ways that would not conflict with any existing
824
+ /// borrows of world data.
822
825
unsafe fn fetch_table (
823
826
world : UnsafeWorldCell < ' _ > ,
824
827
location : EntityLocation ,
825
828
component_id : ComponentId ,
826
829
) -> Option < ( & Column , TableRow ) > {
827
830
let archetype = & world. archetypes ( ) [ location. archetype_id ] ;
828
- let table = & world. unsafe_world ( ) . storages . tables [ archetype. table_id ( ) ] ;
831
+ // SAFETY: caller ensures returned data is not misused
832
+ let table = & unsafe { world. unsafe_world ( ) } . storages . tables [ archetype. table_id ( ) ] ;
829
833
let components = table. get_column ( component_id) ?;
830
834
let table_row = archetype. entity_table_row ( location. archetype_row ) ;
831
835
Some ( ( components, table_row) )
832
836
}
833
837
834
838
#[ inline]
835
- #[ allow( unsafe_op_in_unsafe_fn) ]
839
+ /// # Safety:
840
+ /// - the returned `ComponentSparseSet` is only used in ways that the `world` has permission for.
841
+ /// - the returned `ComponentSparseSet` is only used in ways that would not conflict with any existing
842
+ /// borrows of world data.
836
843
unsafe fn fetch_sparse_set (
837
844
world : UnsafeWorldCell < ' _ > ,
838
845
component_id : ComponentId ,
839
846
) -> Option < & ComponentSparseSet > {
840
- world. unsafe_world ( ) . storages . sparse_sets . get ( component_id)
847
+ // SAFETY: caller ensures returned data is not misused
848
+ unsafe { world. unsafe_world ( ) }
849
+ . storages
850
+ . sparse_sets
851
+ . get ( component_id)
841
852
}
0 commit comments