diff --git a/crates/bevy_ecs/src/archetype.rs b/crates/bevy_ecs/src/archetype.rs index e282901f965f1..a25551f013da3 100644 --- a/crates/bevy_ecs/src/archetype.rs +++ b/crates/bevy_ecs/src/archetype.rs @@ -40,6 +40,7 @@ use std::{ /// [`World`]: crate::world::World /// [`Entities::get`]: crate::entity::Entities #[derive(Debug, Copy, Clone, Eq, PartialEq)] +// SAFETY: Must be repr(transparent) due to the safety requirements on EntityLocation #[repr(transparent)] pub struct ArchetypeRow(u32); @@ -68,6 +69,7 @@ impl ArchetypeRow { /// [`World`]: crate::world::World /// [`EMPTY`]: crate::archetype::ArchetypeId::EMPTY #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +// SAFETY: Must be repr(transparent) due to the safety requirements on EntityLocation #[repr(transparent)] pub struct ArchetypeId(u32); diff --git a/crates/bevy_ecs/src/storage/table.rs b/crates/bevy_ecs/src/storage/table.rs index 5172ec41526e3..fe2fd6cd783ba 100644 --- a/crates/bevy_ecs/src/storage/table.rs +++ b/crates/bevy_ecs/src/storage/table.rs @@ -26,6 +26,8 @@ use std::{ /// [`Archetype`]: crate::archetype::Archetype /// [`Archetype::table_id`]: crate::archetype::Archetype::table_id #[derive(Debug, Clone, Copy, PartialEq, Eq)] +// SAFETY: Must be repr(transparent) due to the safety requirements on EntityLocation +#[repr(transparent)] pub struct TableId(u32); impl TableId { @@ -64,6 +66,8 @@ impl TableId { /// [`Archetype::table_id`]: crate::archetype::Archetype::table_id /// [`Entity`]: crate::entity::Entity #[derive(Debug, Clone, Copy, PartialEq, Eq)] +// SAFETY: Must be repr(transparent) due to the safety requirements on EntityLocation +#[repr(transparent)] pub struct TableRow(u32); impl TableRow {