Skip to content

Commit

Permalink
Remove unnecessary unsafe Send and Sync impl for WinitWindows o…
Browse files Browse the repository at this point in the history
…n wasm. (#5863)

# Objective

bevyengine/bevy#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 <[email protected]>
  • Loading branch information
tim-blackbird and tim-blackbird committed Sep 2, 2022
1 parent 41a8ebe commit a383661
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/winit_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit a383661

Please sign in to comment.