@@ -1558,7 +1558,10 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
1558
1558
pub fn transmute_lens_filtered < NewD : QueryData , NewF : QueryFilter > (
1559
1559
& mut self ,
1560
1560
) -> QueryLens < ' _ , NewD , NewF > {
1561
- // SAFETY: There are no other active borrows of data from world
1561
+ // SAFETY:
1562
+ // - We have exclusive access to the query
1563
+ // - `self` has correctly captured it's access
1564
+ // - Access is checked to be a subset of the query's access when the state is created.
1562
1565
let world = unsafe { self . world . world ( ) } ;
1563
1566
let state = self . state . transmute_filtered :: < NewD , NewF > ( world) ;
1564
1567
QueryLens {
@@ -1592,7 +1595,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
1592
1595
/// See [`Self::transmute_lens`] for more details.
1593
1596
pub fn join < OtherD : QueryData , NewD : QueryData > (
1594
1597
& mut self ,
1595
- other : & Query < OtherD > ,
1598
+ other : & mut Query < OtherD > ,
1596
1599
) -> QueryLens < ' _ , NewD > {
1597
1600
self . join_filtered ( other)
1598
1601
}
@@ -1611,9 +1614,12 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
1611
1614
NewF : QueryFilter ,
1612
1615
> (
1613
1616
& mut self ,
1614
- other : & Query < OtherD , OtherF > ,
1617
+ other : & mut Query < OtherD , OtherF > ,
1615
1618
) -> QueryLens < ' _ , NewD , NewF > {
1616
- // SAFETY: There are no other active borrows of data from world
1619
+ // SAFETY:
1620
+ // - The queries have correctly captured their access.
1621
+ // - We have exclusive access to both queries.
1622
+ // - Access for QueryLens is checked when state is created.
1617
1623
let world = unsafe { self . world . world ( ) } ;
1618
1624
let state = self
1619
1625
. state
0 commit comments