From baaf4c8c2dcf8399797cb99942e2ad474d96c543 Mon Sep 17 00:00:00 2001 From: Eira Fransham Date: Tue, 12 Mar 2024 23:11:21 +0100 Subject: [PATCH] SystemId should manually implement `Eq` (#12436) # Objective `System` currently does not implement `Eq` even though it should ## Solution Manually implement `Eq` like other traits are manually implemented --- crates/bevy_ecs/src/system/system_registry.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/system/system_registry.rs b/crates/bevy_ecs/src/system/system_registry.rs index fa0dd6c4c8..bb4c2fc2d8 100644 --- a/crates/bevy_ecs/src/system/system_registry.rs +++ b/crates/bevy_ecs/src/system/system_registry.rs @@ -38,9 +38,11 @@ impl RemovedSystem { /// /// These are opaque identifiers, keyed to a specific [`World`], /// and are created via [`World::register_system`]. -#[derive(Eq)] pub struct SystemId(Entity, std::marker::PhantomData O>); +// A manual impl is used because the trait bounds should ignore the `I` and `O` phantom parameters. +impl Eq for SystemId {} + // A manual impl is used because the trait bounds should ignore the `I` and `O` phantom parameters. impl Copy for SystemId {}