Skip to content

Make NonSendMarker !Send #19107

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

Conversation

bushrat011899
Copy link
Contributor

Objective

In #18301, NonSendMarker was defined in such a way that it actually implements Send. This isn't strictly a soundness issue, as its goal is to be used as a SystemParam, and it does appropriately mark system access as !Send. It just seems odd that NonSendMarker: Send.

Solution

  • Made NonSendMarker wrap PhantomData<*mut ()>, which forces it to be !Send.

Testing

  • CI

Notes

This does mean constructing a NonSendMarker value will require using the SystemParam trait, but I think that's acceptable as the marker as a value should be rarely required if at all.

@bushrat011899 bushrat011899 added D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change X-Uncontroversial This work is generally agreed upon S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 7, 2025
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very much hoping to remove this for 0.17 but we might as well merge this.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 7, 2025
@alice-i-cecile alice-i-cecile enabled auto-merge May 7, 2025 00:33
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 7, 2025
Merged via the queue into bevyengine:main with commit 4051465 May 7, 2025
45 checks passed
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-Code-Quality A section of code that is hard to understand or change D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants