-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Exclusive systems accessing World
in their signature cannot be chained.
#5248
Labels
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
Comments
AlexOkafor
added
C-Bug
An unexpected or incorrect behavior
S-Needs-Triage
This issue needs to be labelled
labels
Jul 8, 2022
This would be resolved by #4166 I think that |
alice-i-cecile
added
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
and removed
C-Bug
An unexpected or incorrect behavior
S-Needs-Triage
This issue needs to be labelled
labels
Jul 8, 2022
Thanks for the heads up on that PR! Just tried what you suggested and unfortunately won't work as-is (0.7.0). |
alradish
pushed a commit
to alradish/bevy
that referenced
this issue
Jan 22, 2023
# Objective Fix bevyengine#5248. ## Solution Support `In<T>` parameters and allow returning arbitrary types in exclusive systems. --- ## Changelog - Exclusive systems may now be used with system piping. ## Migration Guide Exclusive systems (systems that access `&mut World`) now support system piping, so the `ExclusiveSystemParamFunction` trait now has generics for the `In`put and `Out`put types. ```rust // Before fn my_generic_system<T, Param>(system_function: T) where T: ExclusiveSystemParamFunction<Param> { ... } // After fn my_generic_system<T, In, Out, Param>(system_function: T) where T: ExclusiveSystemParamFunction<In, Out, Param> { ... } ```
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# Objective Fix bevyengine#5248. ## Solution Support `In<T>` parameters and allow returning arbitrary types in exclusive systems. --- ## Changelog - Exclusive systems may now be used with system piping. ## Migration Guide Exclusive systems (systems that access `&mut World`) now support system piping, so the `ExclusiveSystemParamFunction` trait now has generics for the `In`put and `Out`put types. ```rust // Before fn my_generic_system<T, Param>(system_function: T) where T: ExclusiveSystemParamFunction<Param> { ... } // After fn my_generic_system<T, In, Out, Param>(system_function: T) where T: ExclusiveSystemParamFunction<In, Out, Param> { ... } ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
Bevy version
https://github.com/bevyengine/bevy/tree/v0.7.0
83c6ffb
What you did
When trying to setup fallible systems, I had a case where one system needed exclusive access to the world, but could also error. Upon chaining it with an error handler I would get a compile error. Other exclusive systems that didn't refer to the world seemed to work. I'm new to rust so I couldn't exactly make sense of what the type errors was wanting from me. Below is a minimal repo case of the compile error:
What went wrong
I was expecting systems that have the signature:
fn exclusive_2(_world: &mut World) -> std::io::Result<()>
can be chained as exclusive systems, but the compiler suggests there are some trait bounds not being satisfied.Additional information
Compiler error below:
The text was updated successfully, but these errors were encountered: