Skip to content

Commit

Permalink
Fix 1.69 CI clippy lints (#8450)
Browse files Browse the repository at this point in the history
- Fix CI by implementing changes recommended by clippy
- It uncovered a bug in a `bevy_ecs` test. Nice!
  • Loading branch information
nicopap authored Apr 20, 2023
1 parent 347dc09 commit e900bd9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/query/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,8 @@ macro_rules! impl_tuple_fetch {
}

#[inline(always)]
unsafe fn filter_fetch<'w>(
_fetch: &mut Self::Fetch<'w>,
unsafe fn filter_fetch(
_fetch: &mut Self::Fetch<'_>,
_entity: Entity,
_table_row: TableRow
) -> bool {
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_ecs/src/query/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ macro_rules! impl_query_filter_tuple {
}

#[inline(always)]
unsafe fn filter_fetch<'w>(
fetch: &mut Self::Fetch<'w>,
unsafe fn filter_fetch(
fetch: &mut Self::Fetch<'_>,
entity: Entity,
table_row: TableRow
) -> bool {
Expand Down Expand Up @@ -504,8 +504,8 @@ macro_rules! impl_tick_filter {
}

#[inline(always)]
unsafe fn filter_fetch<'w>(
fetch: &mut Self::Fetch<'w>,
unsafe fn filter_fetch(
fetch: &mut Self::Fetch<'_>,
entity: Entity,
table_row: TableRow
) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/storage/sparse_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ mod tests {
);

fn init_component<T: Component>(sets: &mut SparseSets, id: usize) {
let descriptor = ComponentDescriptor::new::<TestComponent1>();
let descriptor = ComponentDescriptor::new::<T>();
let id = ComponentId::new(id);
let info = ComponentInfo::new(id, descriptor);
sets.get_or_insert(&info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ error[E0499]: cannot borrow `e_mut` as mutable more than once at a time
error[E0505]: cannot move out of `e_mut` because it is borrowed
--> tests/ui/entity_ref_mut_lifetime_safety.rs:33:9
|
13 | let mut e_mut = world.entity_mut(e);
| --------- binding `e_mut` declared here
...
32 | let gotten: &A = e_mut.get::<A>().unwrap();
| ---------------- borrow of `e_mut` occurs here
33 | e_mut.despawn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ note: required by a bound in `assert_readonly`
--> tests/ui/system_param_derive_readonly.rs:23:8
|
21 | fn assert_readonly<P>()
| --------------- required by a bound in this
| --------------- required by a bound in this function
22 | where
23 | P: ReadOnlySystemParam,
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_readonly`
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0599]: no method named `get_field` found for struct `Box<(dyn Reflect + '
--> tests/reflect_derive/generics.fail.rs:14:9
|
14 | foo.get_field::<NoReflect>("a").unwrap();
| ^^^^^^^^^ method not found in `Box<(dyn Reflect + 'static)>`
| ^^^^^^^^^ method not found in `Box<dyn Reflect>`

error[E0277]: the trait bound `NoReflect: Reflect` is not satisfied
--> tests/reflect_derive/generics.fail.rs:12:37
Expand Down

0 comments on commit e900bd9

Please sign in to comment.