Closed kyren closed 2 years ago
You could add new trait MaybeSend
(or some better name) that either does or does not have Send
as super trait depending on feature
Yeap, removing the bounds doesn't break API, though I find the fn exec
taking a &mut World
to be a bug... ish, introduced probably by me -- see lazy.rs@a5459b2:L262-L271
, though before that it already held a &mut World
and passed it as &World
to the function.
Fixing that would be a breaking change, but people can simply use exec_mut
anyway.
I'm just wondering if we should relax Sync
for when "parallel"
is enabled.
F
must already beFnOnce
, and theSync
requirement is too strict, it should only requireSend
when theparallel
feature is enabled.Unfortunately I couldn't come up with a clean way of using or modifying the
parallel_feature
macro to do this, so I was forced to copy the doc comments and implementation of exec / exec_mut. If you would rather make an additionalparallel_feature
macro or modify that in some way let me know.Checklist
API changes
I don't think this is a breaking API change since it's strictly reducing the bounds of two LazyUpdate methods. It also removes requirements on two pub traits but they are marked "internal" so hopefully they shouldn't matter?