Skip to content

Commit

Permalink
SystemId should manually implement Eq (#12436)
Browse files Browse the repository at this point in the history
# Objective

`System<f32>` currently does not implement `Eq` even though it should

## Solution

Manually implement `Eq` like other traits are manually implemented
  • Loading branch information
eira-fransham authored and mockersf committed Mar 13, 2024
1 parent 3b97fd6 commit 9f24bd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/bevy_ecs/src/system/system_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ impl<I, O> RemovedSystem<I, O> {
///
/// These are opaque identifiers, keyed to a specific [`World`],
/// and are created via [`World::register_system`].
#[derive(Eq)]
pub struct SystemId<I = (), O = ()>(Entity, std::marker::PhantomData<fn(I) -> O>);

// A manual impl is used because the trait bounds should ignore the `I` and `O` phantom parameters.
impl<I, O> Eq for SystemId<I, O> {}

// A manual impl is used because the trait bounds should ignore the `I` and `O` phantom parameters.
impl<I, O> Copy for SystemId<I, O> {}

Expand Down

0 comments on commit 9f24bd8

Please sign in to comment.