bevy/crates/bevy_ecs/src/query
Tristan Guichaoua c1a4e29a1e
Replace pointer castings (as) by their API equivalent (#11818)
# Objective

Since rust `1.76`,
[`ptr::from_ref`](https://doc.rust-lang.org/stable/std/ptr/fn.from_ref.html)
and
[`ptr::from_mut`](https://doc.rust-lang.org/stable/std/ptr/fn.from_mut.html)
are stable.

This PR replaces code that use `as` casting by one of `ptr::from_ref`,
`ptr::from_mut`, `cast_mut`, `cast_const`, or `cast` methods, which are
less error-prone.

## Solution

- Bump MSRV to `1.76.0`
- Enables the following clippy lints:
-
[`ptr_as_ptr`](https://rust-lang.github.io/rust-clippy/master/index.html#/ptr_as_ptr)
-
[`ptr_cast_constness`](https://rust-lang.github.io/rust-clippy/master/index.html#/ptr_cast_constness)
-
[`ref_as_ptr`](https://rust-lang.github.io/rust-clippy/master/index.html#/ref_as_ptr)
(I fix all warnings for this one, but it requires rust 1.77 to be
enabled)
- Fix the lints mentioned above
2024-02-11 23:19:36 +00:00
..
access.rs Expose query accesses (#11700) 2024-02-10 15:22:07 +00:00
builder.rs Dynamic queries and builder API (#9774) 2024-01-16 19:16:49 +00:00
error.rs Derive Error for more error types (#10240) 2023-10-28 22:20:37 +00:00
fetch.rs Expose query accesses (#11700) 2024-02-10 15:22:07 +00:00
filter.rs Dynamic queries and builder API (#9774) 2024-01-16 19:16:49 +00:00
iter.rs Rename ArchetypeEntity::entity into ArchetypeEntity::id (#11118) 2024-01-01 16:12:24 +00:00
mod.rs Deprecated Various Component Methods from Query and QueryState (#9920) 2024-02-04 01:01:59 +00:00
par_iter.rs Rename Q type parameter to D when referring to WorldQueryData (#10782) 2023-12-13 18:50:46 +00:00
state.rs Replace pointer castings (as) by their API equivalent (#11818) 2024-02-11 23:19:36 +00:00
world_query.rs Dynamic queries and builder API (#9774) 2024-01-16 19:16:49 +00:00