Formalize thread-safety guarantees (#322)

This commit is contained in:
Victor Berger 2017-10-18 20:40:21 +02:00 committed by tomaka
parent 48902297b7
commit 229029f2da
5 changed files with 40 additions and 10 deletions

23
tests/send_objects.rs Normal file
View file

@ -0,0 +1,23 @@
extern crate winit;
fn needs_send<T:Send>() {}
#[test]
fn events_loop_proxy_send() {
// ensures that `winit::EventsLoopProxy` implements `Send`
needs_send::<winit::EventsLoopProxy>();
}
#[test]
fn window_send() {
// ensures that `winit::Window` implements `Send`
needs_send::<winit::Window>();
}
#[test]
fn ids_send() {
// ensures that the various `..Id` types implement `Send`
needs_send::<winit::WindowId>();
needs_send::<winit::DeviceId>();
needs_send::<winit::MonitorId>();
}