@@ -272,7 +272,7 @@ pub unsafe trait ReadOnlyWorldQueryData: WorldQueryData<ReadOnly = Self> {}
272
272
/// The item type returned when a [`WorldQuery`] is iterated over
273
273
pub type QueryItem < ' w , Q > = <Q as WorldQuery >:: Item < ' w > ;
274
274
/// The read-only variant of the item type returned when a [`WorldQueryData`] is iterated over immutably
275
- pub type ROQueryItem < ' w , Q > = QueryItem < ' w , <Q as WorldQueryData >:: ReadOnly > ;
275
+ pub type ROQueryItem < ' w , D > = QueryItem < ' w , <D as WorldQueryData >:: ReadOnly > ;
276
276
277
277
/// SAFETY:
278
278
/// `update_component_access` and `update_archetype_component_access` do nothing.
@@ -1399,27 +1399,27 @@ macro_rules! impl_anytuple_fetch {
1399
1399
all_tuples ! ( impl_tuple_world_query_data, 0 , 15 , F , S ) ;
1400
1400
all_tuples ! ( impl_anytuple_fetch, 0 , 15 , F , S ) ;
1401
1401
1402
- /// [`WorldQuery`] used to nullify queries by turning `Query<Q >` into `Query<NopWorldQuery<Q >>`
1402
+ /// [`WorldQuery`] used to nullify queries by turning `Query<D >` into `Query<NopWorldQuery<D >>`
1403
1403
///
1404
1404
/// This will rarely be useful to consumers of `bevy_ecs`.
1405
- pub struct NopWorldQuery < Q : WorldQueryData > ( PhantomData < Q > ) ;
1405
+ pub struct NopWorldQuery < D : WorldQueryData > ( PhantomData < D > ) ;
1406
1406
1407
1407
/// SAFETY:
1408
1408
/// `update_component_access` and `update_archetype_component_access` do nothing.
1409
1409
/// This is sound because `fetch` does not access components.
1410
- unsafe impl < Q : WorldQueryData > WorldQuery for NopWorldQuery < Q > {
1410
+ unsafe impl < D : WorldQueryData > WorldQuery for NopWorldQuery < D > {
1411
1411
type Fetch < ' w > = ( ) ;
1412
1412
type Item < ' w > = ( ) ;
1413
- type State = Q :: State ;
1413
+ type State = D :: State ;
1414
1414
1415
1415
fn shrink < ' wlong : ' wshort , ' wshort > ( _: ( ) ) { }
1416
1416
1417
- const IS_DENSE : bool = Q :: IS_DENSE ;
1417
+ const IS_DENSE : bool = D :: IS_DENSE ;
1418
1418
1419
1419
#[ inline( always) ]
1420
1420
unsafe fn init_fetch (
1421
1421
_world : UnsafeWorldCell ,
1422
- _state : & Q :: State ,
1422
+ _state : & D :: State ,
1423
1423
_last_run : Tick ,
1424
1424
_this_run : Tick ,
1425
1425
) {
@@ -1428,14 +1428,14 @@ unsafe impl<Q: WorldQueryData> WorldQuery for NopWorldQuery<Q> {
1428
1428
#[ inline( always) ]
1429
1429
unsafe fn set_archetype (
1430
1430
_fetch : & mut ( ) ,
1431
- _state : & Q :: State ,
1431
+ _state : & D :: State ,
1432
1432
_archetype : & Archetype ,
1433
1433
_tables : & Table ,
1434
1434
) {
1435
1435
}
1436
1436
1437
1437
#[ inline( always) ]
1438
- unsafe fn set_table < ' w > ( _fetch : & mut ( ) , _state : & Q :: State , _table : & Table ) { }
1438
+ unsafe fn set_table < ' w > ( _fetch : & mut ( ) , _state : & D :: State , _table : & Table ) { }
1439
1439
1440
1440
#[ inline( always) ]
1441
1441
unsafe fn fetch < ' w > (
@@ -1445,34 +1445,34 @@ unsafe impl<Q: WorldQueryData> WorldQuery for NopWorldQuery<Q> {
1445
1445
) -> Self :: Item < ' w > {
1446
1446
}
1447
1447
1448
- fn update_component_access ( _state : & Q :: State , _access : & mut FilteredAccess < ComponentId > ) { }
1448
+ fn update_component_access ( _state : & D :: State , _access : & mut FilteredAccess < ComponentId > ) { }
1449
1449
1450
1450
fn update_archetype_component_access (
1451
- _state : & Q :: State ,
1451
+ _state : & D :: State ,
1452
1452
_archetype : & Archetype ,
1453
1453
_access : & mut Access < ArchetypeComponentId > ,
1454
1454
) {
1455
1455
}
1456
1456
1457
1457
fn init_state ( world : & mut World ) -> Self :: State {
1458
- Q :: init_state ( world)
1458
+ D :: init_state ( world)
1459
1459
}
1460
1460
1461
1461
fn matches_component_set (
1462
1462
state : & Self :: State ,
1463
1463
set_contains_id : & impl Fn ( ComponentId ) -> bool ,
1464
1464
) -> bool {
1465
- Q :: matches_component_set ( state, set_contains_id)
1465
+ D :: matches_component_set ( state, set_contains_id)
1466
1466
}
1467
1467
}
1468
1468
1469
1469
/// SAFETY: `Self::ReadOnly` is `Self`
1470
- unsafe impl < Q : WorldQueryData > WorldQueryData for NopWorldQuery < Q > {
1470
+ unsafe impl < D : WorldQueryData > WorldQueryData for NopWorldQuery < D > {
1471
1471
type ReadOnly = Self ;
1472
1472
}
1473
1473
1474
1474
/// SAFETY: `NopFetch` never accesses any data
1475
- unsafe impl < Q : WorldQueryData > ReadOnlyWorldQueryData for NopWorldQuery < Q > { }
1475
+ unsafe impl < D : WorldQueryData > ReadOnlyWorldQueryData for NopWorldQuery < D > { }
1476
1476
1477
1477
/// SAFETY:
1478
1478
/// `update_component_access` and `update_archetype_component_access` do nothing.
@@ -1601,14 +1601,14 @@ mod tests {
1601
1601
1602
1602
#[ derive( WorldQueryData ) ]
1603
1603
#[ world_query_data( mutable) ]
1604
- pub struct Q {
1604
+ pub struct D {
1605
1605
pub a : & ' static mut A ,
1606
1606
}
1607
1607
}
1608
1608
1609
- let _ = private:: QReadOnly { a : & A } ;
1609
+ let _ = private:: DReadOnly { a : & A } ;
1610
1610
1611
- fn my_system ( query : Query < private:: Q > ) {
1611
+ fn my_system ( query : Query < private:: D > ) {
1612
1612
for q in & query {
1613
1613
let _ = & q. a ;
1614
1614
}
0 commit comments