From 45e4a3969c312b698dd30f56475c702c930c7492 Mon Sep 17 00:00:00 2001 From: DeveloperMindset123 Date: Wed, 21 May 2025 23:03:22 -0400 Subject: [PATCH 1/2] chore:added compiler_error!() for additional description to vague error occuring due to missing feature. --- crates/bevy_tasks/src/lib.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/bevy_tasks/src/lib.rs b/crates/bevy_tasks/src/lib.rs index ae684a4eb5124..e9ad7f214860a 100644 --- a/crates/bevy_tasks/src/lib.rs +++ b/crates/bevy_tasks/src/lib.rs @@ -6,6 +6,25 @@ )] #![no_std] +#[cfg(all(feature = "multi_threaded", not(feature = "async_executor")))] +compile_error!( + r#" + The "multi_threaded" feature of `bevy_tasks` requires the "async_executor" feature + to be enabled alongside it. + + This is because the multi-threaded task pool relies on an executor to run futures, + which is provided by the "async_executor" feature. + + Please enable the "async_executor" feature in your `Cargo.toml` for `bevy_tasks`: + + [dependencies] + bevy_tasks = { version = "...", default-features = false, features = ["multi_threaded", "async_executor"] } + + If you are using `bevy`'s `DefaultPlugins`, the "async_executor" feature + for `bevy_tasks` is typically enabled automatically via Bevy's default features. +"# +); + #[cfg(feature = "std")] extern crate std; From 89018923462421ae0808b4ed3dc343340b80a0eb Mon Sep 17 00:00:00 2001 From: DeveloperMindset123 Date: Sun, 8 Jun 2025 17:50:33 -0400 Subject: [PATCH 2/2] Removed previous compiler_error!() for error when multi_threaded feature is enabled but async_executor is not. --- crates/bevy_tasks/Cargo.toml | 7 ++++++- crates/bevy_tasks/src/lib.rs | 19 ------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/crates/bevy_tasks/Cargo.toml b/crates/bevy_tasks/Cargo.toml index 70b3aaf2e896e..ad162a7ef74ff 100644 --- a/crates/bevy_tasks/Cargo.toml +++ b/crates/bevy_tasks/Cargo.toml @@ -15,7 +15,12 @@ default = ["std", "async_executor"] ## Enables multi-threading support. ## Without this feature, all tasks will be run on a single thread. -multi_threaded = ["std", "dep:async-channel", "dep:concurrent-queue"] +multi_threaded = [ + "std", + "dep:async-channel", + "dep:concurrent-queue", + "async_executor", +] ## Uses `async-executor` as a task execution backend. ## This backend is incompatible with `no_std` targets. diff --git a/crates/bevy_tasks/src/lib.rs b/crates/bevy_tasks/src/lib.rs index 890266a61f8b0..ce9aa788835e0 100644 --- a/crates/bevy_tasks/src/lib.rs +++ b/crates/bevy_tasks/src/lib.rs @@ -6,25 +6,6 @@ )] #![no_std] -#[cfg(all(feature = "multi_threaded", not(feature = "async_executor")))] -compile_error!( - r#" - The "multi_threaded" feature of `bevy_tasks` requires the "async_executor" feature - to be enabled alongside it. - - This is because the multi-threaded task pool relies on an executor to run futures, - which is provided by the "async_executor" feature. - - Please enable the "async_executor" feature in your `Cargo.toml` for `bevy_tasks`: - - [dependencies] - bevy_tasks = { version = "...", default-features = false, features = ["multi_threaded", "async_executor"] } - - If you are using `bevy`'s `DefaultPlugins`, the "async_executor" feature - for `bevy_tasks` is typically enabled automatically via Bevy's default features. -"# -); - #[cfg(feature = "std")] extern crate std;