Formalize thread-safety guarantees (#322)
This commit is contained in:
parent
48902297b7
commit
229029f2da
5 changed files with 40 additions and 10 deletions
23
tests/send_objects.rs
Normal file
23
tests/send_objects.rs
Normal 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>();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue