winit/tests/sync_object.rs
Kirill Chibisov 801fddbfcf
Make WindowBuilder Send + Sync
Window builder is always accessed by winit on the thread event loop
is on, thus it's safe to mark the data it gets as `Send + Sync`.
Each unsafe object is marked individually as `Send + Sync` instead
of just implementing `Send` and `Sync` for the whole builder.
2023-10-17 04:54:12 +04:00

13 lines
263 B
Rust

#[allow(dead_code)]
fn needs_sync<T: Sync>() {}
#[test]
fn window_sync() {
// ensures that `winit::Window` implements `Sync`
needs_sync::<winit::window::Window>();
}
#[test]
fn window_builder_sync() {
needs_sync::<winit::window::WindowBuilder>();
}