-
-
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
Add assert_is_exclusive_system
function
#4788
Comments
Surely we should just wait for #4166 (or well, an updated version addressing the concerns)? |
I added the PR link to the alternatives. That being said, I think this can stay open for newcomers that want to do their first PR. Or maybe not, for a change that will get reverted soon. I don't know, I'll leave it up to the maintainers. |
My feeling is that #4166 is preferred, but I would probably vote in favor of merging a PR that added this, since it should be easily caught during the refactor. |
Is #4166 going to be merged before 0.8? Alternatively this would be a rather trivial change that can easily land on the next release. |
I think that's unlikely to be a high enough priority; I would be happy to merge a tiny PR adding this. |
Fine. I'm going to mark this as good first issue, since its implementation can be literally based on |
Add compile time check for if a system is an exclusive system. Resolves #4788 Co-authored-by: Daniel Liu <mr.picklepinosaur@gmail.com> Co-authored-by: Daniel Liu <danieliu3120@gmail.com>
Add compile time check for if a system is an exclusive system. Resolves bevyengine#4788 Co-authored-by: Daniel Liu <mr.picklepinosaur@gmail.com> Co-authored-by: Daniel Liu <danieliu3120@gmail.com>
Add compile time check for if a system is an exclusive system. Resolves bevyengine#4788 Co-authored-by: Daniel Liu <mr.picklepinosaur@gmail.com> Co-authored-by: Daniel Liu <danieliu3120@gmail.com>
Add compile time check for if a system is an exclusive system. Resolves bevyengine#4788 Co-authored-by: Daniel Liu <mr.picklepinosaur@gmail.com> Co-authored-by: Daniel Liu <danieliu3120@gmail.com>
What problem does this solve or what need does it fill?
We already have
assert_is_system
, but it does not work with systems that take&mut World
.What solution would you like?
A function called
assert_is_exclusive_system
that does nothing if the argument implementsIntoExclusiveSystem
, and fails to compile otherwise.What alternative(s) have you considered?
Alternatively, you can try to do this:
but it's ugly, and it's not symmetric with
assert_is_system
.Another alternative is to wait for #4166 to be merged, which would deprecate exclusive systems as a special type of system.
Additional context
if false
crime that has been committed againstassert_is_system
.#[allow(UnusedVariables)]
attribute, otherwise we would have to prefix underscore the parameter (ugly).The text was updated successfully, but these errors were encountered: