bevy/crates/bevy_ecs/macros
JoJoJet 42732c0815 Make #[system_param(ignore)] and #[world_query(ignore)] unnecessary (#8030)
When using `PhantomData` fields with the `#[derive(SystemParam)]` or
`#[derive(WorldQuery)]` macros, the user is required to add the
`#[system_param(ignore)]` attribute so that the macro knows to treat
that field specially. This is undesirable, since it makes the macro more
fragile and less consistent.

Implement `SystemParam` and `WorldQuery` for `PhantomData`. This makes
the `ignore` attributes unnecessary.

Some internal changes make the derive macro compatible with types that
have invariant lifetimes, which fixes #8192. From what I can tell, this
fix requires `PhantomData` to implement `SystemParam` in order to ensure
that all of a type's generic parameters are always constrained.

---

+ Implemented `SystemParam` and `WorldQuery` for `PhantomData<T>`.
+ Fixed a miscompilation caused when invariant lifetimes were used with
the `SystemParam` macro.
2023-03-31 13:33:36 -07:00
..
src Make #[system_param(ignore)] and #[world_query(ignore)] unnecessary (#8030) 2023-03-31 13:33:36 -07:00
Cargo.toml Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00