bevyengine / bevyengine/bevy

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

Open
#18,243 5 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Bug C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

Main branch https://github.com/bevyengine/bevy/commit/3b9e2e640f41fcc7c83dc477161e1b6b96764585

## 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.