bevy/crates
Ben Frankel 0a841ba9c1
Cache systems by S instead of S::System (#16694)
# Objective

- Fixes the issue described in this comment:
https://github.com/bevyengine/bevy/issues/16680#issuecomment-2522764239.

## Solution

- Cache one-shot systems by `S: IntoSystem` (which is const-asserted to
be a ZST) rather than `S::System`.

## Testing

Added a new unit test named `cached_system_into_same_system_type` to
`system_registry.rs`.

---

## Migration Guide

The `CachedSystemId` resource has been changed:

```rust
// Before:
let cached_id = CachedSystemId::<S::System>(id);
assert!(id == cached_id.0);

// After:
let cached_id = CachedSystemId::<S>::new(id);
assert!(id == SystemId::from_entity(cached_id.entity));
```
2025-03-04 07:31:10 +00:00
..
bevy_a11y Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_animation Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_app Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_asset Make asset watcher work when path contains "../" (#18023) 2025-03-02 18:15:27 +00:00
bevy_audio Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_color Allow bevy_reflect and wgpu-types features in no_std for bevy_color (#18061) 2025-03-01 00:31:35 +00:00
bevy_core_pipeline Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_derive Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_dev_tools Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_diagnostic Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_dylib Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_ecs Cache systems by S instead of S::System (#16694) 2025-03-04 07:31:10 +00:00
bevy_encase_derive Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_gilrs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_gizmos Incorporate OIT into MeshPipelineKey used by the LineGizmoPipeline (#17946) 2025-02-24 21:31:54 +00:00
bevy_gltf Update itertools requirement from 0.13 to 0.14 (#18128) 2025-03-03 19:36:29 +00:00
bevy_image Update ruzstd requirement from 0.7.0 to 0.8.0 (#18145) 2025-03-03 21:44:51 +00:00
bevy_input Fix incorrect doc about GamepadAxis::RightZ/LeftZ (#18114) 2025-03-02 19:18:01 +00:00
bevy_input_focus Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_internal Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_log Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_macro_utils Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_math Update itertools requirement from 0.13 to 0.14 (#18128) 2025-03-03 19:36:29 +00:00
bevy_mesh Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_mikktspace Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_pbr Update itertools requirement from 0.13 to 0.14 (#18128) 2025-03-03 19:36:29 +00:00
bevy_picking Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_platform_support Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_ptr moved Debug from derive to impl_ptr in bevy_ptr (#18042) 2025-02-28 02:54:46 +00:00
bevy_reflect Improve bevy_reflect no_std support (#18060) 2025-02-27 06:16:10 +00:00
bevy_remote BRP resource methods (#17423) 2025-02-26 20:29:47 +00:00
bevy_render Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_scene Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_sprite Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_state Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_tasks TaskPool: Prefer task completion over executing new tasks (#18009) 2025-02-26 00:08:36 +00:00
bevy_text Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
bevy_time Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_transform Remove ChildOf::get and Deref impl (#18080) 2025-02-27 23:11:03 +00:00
bevy_ui Val::resolve doc comment fix (#18143) 2025-03-03 19:49:52 +00:00
bevy_utils Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_window Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
bevy_winit Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00