diff --git a/CHANGELOG.md b/CHANGELOG.md index e245aeb..d60608a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 0.4.1 - 2024-03-24 + +- Impl `Send` and `Sync` for `UnsafeWorldCell` and `Fetcher`. +- Removed dependency on `memoffset`. + ## 0.4.0 - 2024-03-09 - Renamed "system" to "handler" to avoid confusion with other ECS libraries. diff --git a/Cargo.toml b/Cargo.toml index 6c40b76..bec8946 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ rayon = ["dep:rayon"] [dependencies] ahash = { version = "0.8.7", default-features = false } bumpalo = "3.14.0" -evenio_macros = { path = "evenio_macros", version = "0.4.0" } +evenio_macros = { path = "evenio_macros", version = "0.4.1" } hashbrown = { version = "0.14.3", default-features = false, features = [ "inline-more", ] } @@ -61,7 +61,7 @@ harness = false [workspace.package] edition = "2021" -version = "0.4.0" +version = "0.4.1" license = "MIT" repository = "https://github.com/rj00a/evenio" diff --git a/src/fetch.rs b/src/fetch.rs index dc5bf81..a269a81 100644 --- a/src/fetch.rs +++ b/src/fetch.rs @@ -960,4 +960,10 @@ mod tests { world.send(E1); } + + fn _assert_auto_trait_impls() + where + for<'a> Fetcher<'a, Q>: Send + Sync, + { + } } diff --git a/src/world.rs b/src/world.rs index c59f31d..dd9fdf1 100644 --- a/src/world.rs +++ b/src/world.rs @@ -1104,6 +1104,11 @@ impl<'a> UnsafeWorldCell<'a> { } } +// SAFETY: `&World` and `&mut World` are `Send`. +unsafe impl Send for UnsafeWorldCell<'_> {} +// SAFETY: `&World` and `&mut World` are `Sync`. +unsafe impl Sync for UnsafeWorldCell<'_> {} + #[cfg(test)] mod tests { use alloc::sync::Arc; @@ -1222,6 +1227,8 @@ mod tests { fn _assert_auto_trait_impls() where World: Send + Sync + UnwindSafe + RefUnwindSafe, + for<'a> &'a World: Send + Sync, + for<'a> &'a mut World: Send + Sync, { } }