Skip to content

Commit e4ef43f

Browse files
committed
Reword query docs for clarity
1 parent edec58e commit e4ef43f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/world.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,15 +369,14 @@ impl World {
369369
/// documentation for details.
370370
///
371371
/// Iterating a query will panic if it would violate an existing unique reference or construct
372-
/// an invalid unique reference. This occurs when two simultaneously-active queries could expose
373-
/// the same entity. Simultaneous queries can access the same component type if and only if the
374-
/// world contains no entities that have all components required by both queries, assuming no
375-
/// other component borrows are outstanding.
372+
/// an invalid unique reference. This occurs when two simultaneously-active queries could alias
373+
/// a mutable reference to the same component of the same entity. Simultaneous queries which
374+
/// refer to the same component type, where at least one takes a mutable reference, can coexist
375+
/// if and only if the world contains no entities that have all components required by both
376+
/// queries.
376377
///
377378
/// Iterating a query yields references with lifetimes bound to the [`QueryBorrow`] returned
378-
/// here. To ensure those are invalidated, the return value of this method must be dropped for
379-
/// its dynamic borrows from the world to be released. Similarly, lifetime rules ensure that
380-
/// references obtained from a query cannot outlive the [`QueryBorrow`].
379+
/// here. This allows the [`QueryBorrow`] to safely implement dynamic borrow checks.
381380
///
382381
/// # Example
383382
/// ```

0 commit comments

Comments
 (0)