From 13d3de8ee11b3cef2ed3f7389c180eaec78fd35f Mon Sep 17 00:00:00 2001 From: Ian Kettlewell Date: Tue, 9 Jan 2024 13:31:55 -0500 Subject: [PATCH] Remove unnecessary unsafe impls for WinitWindows on Wasm (#11270) # Objective In the past `winit::window::Window` was not Send + Sync on web. https://github.com/rust-windowing/winit/pull/2834 made `winit::window::Window` Sync + Send so Bevy's `unsafe impl` is no longer necessary. ## Solution Remove the unsafe impls. --- 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 865eb7a02e..819d170252 100644 --- a/crates/bevy_winit/src/winit_windows.rs +++ b/crates/bevy_winit/src/winit_windows.rs @@ -356,9 +356,3 @@ pub fn winit_window_position( } } } - -// 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 {}