From 9672f900913ca8fc15e2b5311564532054b022be Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 15 Aug 2016 10:55:34 -0700 Subject: [PATCH] Remove lots of 'static bounds The core trait and associated types no longer require the `'static` bounds, and all associated methods have also had the `'static` bounds removed. The only location for the `'static` bound is `forget`. While the restriction of `'static` on `forget` is here to stay, we'll soon enable `Loop::run` to take a non-`'static` future, allowing driving a non-`'static` future. --- src/event_loop.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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| {