@@ -1505,7 +1505,10 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
1505
1505
pub fn transmute_lens_filtered < NewD : QueryData , NewF : QueryFilter > (
1506
1506
& mut self ,
1507
1507
) -> QueryLens < ' _ , NewD , NewF > {
1508
- // SAFETY: There are no other active borrows of data from world
1508
+ // SAFETY:
1509
+ // - We have exclusive access to the query
1510
+ // - `self` has correctly captured it's access
1511
+ // - Access is checked to be a subset of the query's access when the state is created.
1509
1512
let world = unsafe { self . world . world ( ) } ;
1510
1513
let state = self . state . transmute_filtered :: < NewD , NewF > ( world) ;
1511
1514
QueryLens {
@@ -1539,7 +1542,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
1539
1542
/// See [`Self::transmute_lens`] for more details.
1540
1543
pub fn join < OtherD : QueryData , NewD : QueryData > (
1541
1544
& mut self ,
1542
- other : & Query < OtherD > ,
1545
+ other : & mut Query < OtherD > ,
1543
1546
) -> QueryLens < ' _ , NewD > {
1544
1547
self . join_filtered ( other)
1545
1548
}
@@ -1558,9 +1561,12 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
1558
1561
NewF : QueryFilter ,
1559
1562
> (
1560
1563
& mut self ,
1561
- other : & Query < OtherD , OtherF > ,
1564
+ other : & mut Query < OtherD , OtherF > ,
1562
1565
) -> QueryLens < ' _ , NewD , NewF > {
1563
- // SAFETY: There are no other active borrows of data from world
1566
+ // SAFETY:
1567
+ // - The queries have correctly captured their access.
1568
+ // - We have exclusive access to both queries.
1569
+ // - Access for QueryLens is checked when state is created.
1564
1570
let world = unsafe { self . world . world ( ) } ;
1565
1571
let state = self
1566
1572
. state
0 commit comments