Skip to content

EntityHashSet can't be used as a relationship target collection because it doesn't implement VisitEntitiesMut #18243

Open
@Brezak

Description

@Brezak

Bevy version

Main branch 3b9e2e6

What you did

  • Tried to implement RelationshipSourceCollection for EntityIndexMap.
  • Encountered error.
  • Attempted to use EntityHashSet to double check.
  • Same error.

What went wrong

The Component derive macro implements visit_entities_mut by using VisitEntitiesMut. EntityHashSet and friends can't implement VisitEntitiesMut since mutable access to it's keys could break internal invariants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions