From 1468211e2bb91c528098fbe1c7f9c3d8bbb072c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Tue, 8 Feb 2022 02:59:54 +0000 Subject: [PATCH] fix unreachable macro calls for rust 2021 (#3889) # Objective - It was decided in Rust 2021 to make macro like `panic` require a string literal to format instead of directly an object - `unreachable` was missed during the first pass but it was decided to go for it anyway now: https://github.com/rust-lang/rust/issues/92137#issuecomment-1019519285 - this is making Bevy CI fail now: https://github.com/bevyengine/bevy/runs/5102586734?check_suite_focus=true ## Solution - Fix calls to `unreachable` --- crates/bevy_ecs/src/schedule/executor_parallel.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_ecs/src/schedule/executor_parallel.rs b/crates/bevy_ecs/src/schedule/executor_parallel.rs index ec8d5a3079..99515de252 100644 --- a/crates/bevy_ecs/src/schedule/executor_parallel.rs +++ b/crates/bevy_ecs/src/schedule/executor_parallel.rs @@ -132,7 +132,7 @@ impl ParallelSystemExecutor for ParallelExecutor { .finish_receiver .recv() .await - .unwrap_or_else(|error| unreachable!(error)); + .unwrap_or_else(|error| unreachable!("{}", error)); self.process_finished_system(index); // Gather other systems than may have finished. while let Ok(index) = self.finish_receiver.try_recv() { @@ -208,7 +208,7 @@ impl ParallelExecutor { start_receiver .recv() .await - .unwrap_or_else(|error| unreachable!(error)); + .unwrap_or_else(|error| unreachable!("{}", error)); #[cfg(feature = "trace")] let system_guard = system_span.enter(); unsafe { system.run_unsafe((), world) }; @@ -217,7 +217,7 @@ impl ParallelExecutor { finish_sender .send(index) .await - .unwrap_or_else(|error| unreachable!(error)); + .unwrap_or_else(|error| unreachable!("{}", error)); }; #[cfg(feature = "trace")] @@ -268,7 +268,7 @@ impl ParallelExecutor { .start_sender .send(()) .await - .unwrap_or_else(|error| unreachable!(error)); + .unwrap_or_else(|error| unreachable!("{}", error)); self.running.set(index, true); if !system_metadata.is_send { self.non_send_running = true;