bevy/crates/bevy_ecs/src/world
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
..
entity_ref.rs Dynamic queries and builder API (#9774) 2024-01-16 19:16:49 +00:00
error.rs Replace all labels with interned labels (#7762) 2023-10-25 21:39:23 +00:00
identifier.rs impl ExclusiveSystemParam for WorldId (#11164) 2024-01-01 15:59:53 +00:00
mod.rs Make Archetypes.archetype_component_count private (#10774) 2024-02-03 00:07:50 +00:00
spawn_batch.rs Fix some nightly warnings (#9672) 2023-09-02 18:35:06 +00:00
unsafe_world_cell.rs Replace pointer castings (as) by their API equivalent (#11818) 2024-02-11 23:19:36 +00:00
world_cell.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00