-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - move system_param fetch struct into anonymous scope to avoid name collisions #4100
Conversation
Is there a reason we don't use the I think this code might have been originally written before that technique was known? |
@robtfm this is a good change that I'd like to merge. Can you rebase? |
4e80f3a
to
b68ae8d
Compare
just want to flag that this is a public api breaking change that will affect at least one 3rd party crate (bevy-console). i think that doesn't automatically make it "controversial", but i am not up to date on all the new process discussions. |
I disagree that this is a public api breaking change - the implementation details of the |
it uses the fetch struct for manual event reader/writers: https://github.com/RichoDemus/bevy-console/blob/6bfa88d357a45df2ea117d445691fe1dd4dcb8b7/src/console.rs#L301. |
@robftm can you add a very short migration guide to the PR description? Very niche, but it's nice to have some insight into why unusual code broke. |
added, largely mirroring the comment |
bors r+ |
…lisions (#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
This PR was included in a batch that was canceled, it will be automatically retried |
…lisions (#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
Build failed (retrying...): |
…lisions (#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
This PR was included in a batch that was canceled, it will be automatically retried |
…lisions (#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
This PR was included in a batch that timed out, it will be automatically retried |
…lisions (#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
This PR was included in a batch that timed out, it will be automatically retried |
…lisions (#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
…lisions (bevyengine#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
…lisions (bevyengine#4100) # Objective avoid naming collisions with user structs when deriving ``system_param``. ## Solution ~rename the fetch struct created by ``#[derive(system_param)]`` from ``{}State`` to ``{}SysParamState``.~ place the fetch struct into an anonymous scope. ## Migration Guide For code that was using a system param's fetch struct, such as ``EventReader``'s ``EventReaderState``, the fetch struct can now be identified via the SystemParam trait associated type ``Fetch``, e.g. for ``EventReader<T>`` it can be identified as ``<EventReader<'static, 'static, T> as SystemParam>::Fetch``
Objective
avoid naming collisions with user structs when deriving
system_param
.Solution
rename the fetch struct created by#[derive(system_param)]
from{}State
to{}SysParamState
.place the fetch struct into an anonymous scope.
Migration Guide
For code that was using a system param's fetch struct, such as
EventReader
'sEventReaderState
, the fetch struct can now be identified via the SystemParam trait associated typeFetch
, e.g. forEventReader<T>
it can be identified as<EventReader<'static, 'static, T> as SystemParam>::Fetch