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

View file

@ -41,7 +41,12 @@ pub trait EventsLoopExt {
impl EventsLoopExt for EventsLoop {
#[inline]
fn new_x11() -> Result<Self, XNotSupported> {
LinuxEventsLoop::new_x11().map(|ev| EventsLoop { events_loop: ev })
LinuxEventsLoop::new_x11().map(|ev|
EventsLoop {
events_loop: ev,
_marker: ::std::marker::PhantomData,
}
)
}
#[inline]
@ -50,7 +55,8 @@ impl EventsLoopExt for EventsLoop {
events_loop: match LinuxEventsLoop::new_wayland() {
Ok(e) => e,
Err(_) => panic!() // TODO: propagate
}
},
_marker: ::std::marker::PhantomData,
}
}