From fd0297b91b68f1d8d48fdcdbee1f7d6c6ed1dfb1 Mon Sep 17 00:00:00 2001 From: ira Date: Fri, 2 Sep 2022 16:17:46 +0000 Subject: [PATCH] Remove unnecessary unsafe `Send` and `Sync` impl for `WinitWindows` on wasm. (#5863) # Objective https://github.com/bevyengine/bevy/pull/503 added these. I don't know what problem it solved, the PR doesn't say and the code didn't make it obvious to me. ## Solution AFAIK removing unsafe `Send`/`Sync` impls can't introduce unsoundness. Yeet. ## Migration Guide Why tho. Co-authored-by: devil-ira --- crates/bevy_winit/src/winit_windows.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/bevy_winit/src/winit_windows.rs b/crates/bevy_winit/src/winit_windows.rs index 2cf90765fcb083..3eb514daad5900 100644 --- a/crates/bevy_winit/src/winit_windows.rs +++ b/crates/bevy_winit/src/winit_windows.rs @@ -264,9 +264,3 @@ pub fn get_best_videomode(monitor: &winit::monitor::MonitorHandle) -> winit::mon modes.first().unwrap().clone() } - -// WARNING: this only works under the assumption that wasm runtime is single threaded -#[cfg(target_arch = "wasm32")] -unsafe impl Send for WinitWindows {} -#[cfg(target_arch = "wasm32")] -unsafe impl Sync for WinitWindows {}