diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs index ad1960a686d8f..e8f5546b45b58 100644 --- a/crates/bevy_ecs/src/entity/mod.rs +++ b/crates/bevy_ecs/src/entity/mod.rs @@ -1276,6 +1276,8 @@ impl EntityMeta { /// A location of an entity in an archetype. #[derive(Copy, Clone, Debug, PartialEq)] +// Specifying alignment helps codegen around `UnsafeEntityCell`. +#[repr(align(8))] pub struct EntityLocation { /// The ID of the [`Archetype`] the [`Entity`] belongs to. ///