Panic from the default impl of Runnable::handler

This will allow us to make sure that tasks using main_thread_handler don't
actually get consumed through a call to the bare handler method.
This commit is contained in:
Anthony Ramine 2017-09-08 10:21:28 +02:00
parent 53d30d85b3
commit 0c33d6168e

View file

@ -251,7 +251,9 @@ where
pub trait Runnable {
fn name(&self) -> &'static str { unsafe { intrinsics::type_name::<Self>() } }
fn handler(self: Box<Self>) {}
fn handler(self: Box<Self>) {
panic!("This should probably be redefined.")
}
fn main_thread_handler(self: Box<Self>, _script_thread: &ScriptThread) { self.handler(); }
}