From 0c33d6168e1eda13ee260ee71fa03365ab2cad52 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 8 Sep 2017 10:21:28 +0200 Subject: [PATCH] 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. --- components/script/script_thread.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 1a69c10dcfa..207e47572e7 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -251,7 +251,9 @@ where pub trait Runnable { fn name(&self) -> &'static str { unsafe { intrinsics::type_name::() } } - fn handler(self: Box) {} + fn handler(self: Box) { + panic!("This should probably be redefined.") + } fn main_thread_handler(self: Box, _script_thread: &ScriptThread) { self.handler(); } }