Bevy version
Potentially every one since QueryState::par_for_each_unchecked_manual was introduced.
What went wrong
The safety invariant on Fetch::init_fetch requires that must be legal for the fetch to access all matched components for a query, which is not true for QueryState::par_for_each_unchecked_manual, since it's initializing multiple Fetches in parallel and forcing them to access mutually exclusive parts of the query results. Either:
- ...the safety invariant needs to be more clearly worded and dependent safety invariants updated.
- ...we should be using a more scoped way to fetch query results.
Given that Fetch implementations are the lowest in the access hierarchy, I'd suggest option 1 and being more stringent in how we pair Fetch initialization and retrieval.
Bevy version
Potentially every one since QueryState::par_for_each_unchecked_manual was introduced.
What went wrong
The safety invariant on
Fetch::init_fetchrequires that must be legal for the fetch to access all matched components for a query, which is not true forQueryState::par_for_each_unchecked_manual, since it's initializing multiple Fetches in parallel and forcing them to access mutually exclusive parts of the query results. Either:Given that Fetch implementations are the lowest in the access hierarchy, I'd suggest option 1 and being more stringent in how we pair Fetch initialization and retrieval.