diff --git a/src/event_loop.rs b/src/event_loop.rs index 9e6c750be..aef92b62b 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -195,7 +195,9 @@ impl Loop { /// otherwise waiting for the future to complete. /// /// Returns the value that the future resolves to. - pub fn run(&mut self, f: F) -> Result { + pub fn run(&mut self, f: F) -> Result + where F: Future + 'static, + { let (tx_res, rx_res) = mpsc::channel(); let handle = self.handle(); self.add_loop_data(f.then(move |res| {