-
-
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
[Merged by Bors] - implement DetectChanges for NonSendMut #2326
[Merged by Bors] - implement DetectChanges for NonSendMut #2326
Conversation
could you do the same for |
That can't currently be done because these impl macros assume things like |
Short term I think we should just merge this as-is |
bors r+ |
Yep! Sure I like this idea. |
# Objective - The `DetectChanges` trait is used for types that detect change on mutable access (such as `ResMut`, `Mut`, etc...) - `DetectChanges` was not implemented for `NonSendMut` ## Solution - implement `NonSendMut` in terms of `DetectChanges`
Pull request successfully merged into main. Build succeeded: |
@cart As a quick clarification, only the mutable variants And lastly, are there any other structs other than |
Correct. set_changed requires unique mutable access to a component, so only mutable pointers can safely do this
|
# Objective - The `DetectChanges` trait is used for types that detect change on mutable access (such as `ResMut`, `Mut`, etc...) - `DetectChanges` was not implemented for `NonSendMut` ## Solution - implement `NonSendMut` in terms of `DetectChanges`
Objective
DetectChanges
trait is used for types that detect change on mutable access (such asResMut
,Mut
, etc...)DetectChanges
was not implemented forNonSendMut
Solution
NonSendMut
in terms ofDetectChanges