-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Move futures.rs
, ConditionalSend
and BoxedFuture
types to bevy_tasks
#16951
base: main
Are you sure you want to change the base?
Conversation
Wondering if the added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree with this change, just need to remove the alloc
feature from bevy_tasks
since we can safely assume access to an allocator.
crates/bevy_tasks/Cargo.toml
Outdated
@@ -10,7 +10,9 @@ keywords = ["bevy"] | |||
|
|||
[features] | |||
default = ["std", "async_executor"] | |||
alloc = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within bevy_tasks
, alloc
is mandatory, so this feature isn't required.
crates/bevy_tasks/src/lib.rs
Outdated
pub trait ConditionalSendFuture: core::future::Future + ConditionalSend {} | ||
impl<T: core::future::Future + ConditionalSend> ConditionalSendFuture for T {} | ||
|
||
#[cfg(feature = "alloc")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be sufficient to just remove these cfg(...)
attributes in order to remove the alloc
feature. This will also need to be done in futures.rs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for chiming in on this one, I was unsure what to do with it.
Removed the feature and the cfgs. There were no instances of this in futures.rs
FWIW.
Objective
Solution
futures.rs
,ConditionalSend
ConditionalSendFuture
andBoxedFuture
frombevy_utils
tobevy_tasks
.Testing
Migration Guide
bevy_utils
intobevy_tasks
:bevy_utils::futures
imports withbevy_tasks::futures
.bevy_utils::ConditionalSend
withbevy_tasks::ConditionalSend
.bevy_utils::ConditionalSendFuture
withbevy_tasks::ConditionalSendFuture
.bevy_utils::BoxedFuture
withbevy_tasks::BoxedFuture
.