bevy/crates/bevy_utils/src
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
..
cow_arc.rs impl Borrow and AsRef for CowArc (#11616) 2024-01-30 14:27:53 +00:00
default.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
float_ord.rs Document That FloatOrd Implements Hash and Eq Too (#5228) 2022-07-11 14:11:27 +00:00
futures.rs Async pipeline compilation (#10812) 2024-02-05 13:50:50 +00:00
intern.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
label.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
lib.rs Deprecating hashbrown reexports (#11721) 2024-02-06 18:04:46 +00:00
once.rs move once from bevy_log to bevy_utils, to allow for it's use in bevy_ecs (#11419) 2024-01-19 06:07:41 +00:00
short_names.rs change 'collapse_type_name' to retain enum types (#9587) 2023-08-26 14:50:12 +00:00
synccell.rs Replace pointer castings (as) by their API equivalent (#11818) 2024-02-11 23:19:36 +00:00
syncunsafecell.rs Replace pointer castings (as) by their API equivalent (#11818) 2024-02-11 23:19:36 +00:00
uuid.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00