bevy/crates/bevy_utils/src
JoJoJet ae39b07d26
Replace some unsafe system executor code with safe code (#8274)
# Objective

The function `SyncUnsafeCell::from_mut` returns `&SyncUnsafeCell<T>`,
even though it could return `&mut SyncUnsafeCell<T>`. This means it is
not possible to call `get_mut` on the returned value, so you need to use
unsafe code to get exclusive access back.

## Solution

Return `&mut Self` instead of `&Self` in `SyncUnsafeCell::from_mut`.
This is consistent with my proposal for `UnsafeCell::from_mut`:
https://github.com/rust-lang/libs-team/issues/198.

Replace an unsafe pointer dereference with a safe call to `get_mut`.

---

## Changelog

+ The function `bevy_utils::SyncUnsafeCell::get_mut` now returns a value
of type `&mut SyncUnsafeCell<T>`. Previously, this returned an immutable
reference.

## Migration Guide

The function `bevy_utils::SyncUnsafeCell::get_mut` now returns a value
of type `&mut SyncUnsafeCell<T>`. Previously, this returned an immutable
reference.
2023-03-31 21:56:49 +00:00
..
default.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
float_ord.rs Document That FloatOrd Implements Hash and Eq Too (#5228) 2022-07-11 14:11:27 +00:00
futures.rs Document remaining members of bevy_utils (#6897) 2022-12-11 18:46:42 +00:00
label.rs Migrate engine to Schedule v3 (#7267) 2023-02-06 02:04:50 +00:00
lib.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
short_names.rs Retain :: after >, ) or ] when shortening type names (#7755) 2023-02-20 15:31:08 +00:00
synccell.rs Fix some typos (#7763) 2023-02-20 22:56:57 +00:00
syncunsafecell.rs Replace some unsafe system executor code with safe code (#8274) 2023-03-31 21:56:49 +00:00