Skip to content
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

NonSend resources cannot be accessed using World::resource_scope #4159

Closed
alice-i-cecile opened this issue Mar 8, 2022 · 3 comments
Closed
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior C-Usability A simple quality-of-life change that makes Bevy easier to use

Comments

@alice-i-cecile
Copy link
Member

The current bound on World::resource_scope is too tight: we require Send + Sync in the form of the Resource trait, when there's no need for it.

As a result, there's no way to use resource_scope with NonSend resources, which is a frustrating inconsistency.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use labels Mar 8, 2022
@james7132
Copy link
Member

#6037 was also asking for this, and #6113 added support for this in World::resource_scope.

Closing this issue as this is already done.

However, #6534 is potentially looking to remove support for this as NonSend resources are likely to be moved outside of World in the future, should #6534 be merged and someone was actually reliant on this functionality, this issue should be reopened.

@RaasAhsan
Copy link

What is the recommended way to do this on 0.11?

@alice-i-cecile
Copy link
Member Author

Use a SystemState.

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-Bug An unexpected or incorrect behavior C-Usability A simple quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

No branches or pull requests

3 participants