SystemId should manually implement Eq (#12436)

# Objective

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

## Solution

Manually implement `Eq` like other traits are manually implemented
This commit is contained in:
Eira Fransham 2024-03-12 23:11:21 +01:00 committed by GitHub
parent 3f6300dc81
commit baaf4c8c2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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> {}