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.
This commit is contained in:
Alex Crichton 2016-08-15 10:55:34 -07:00
parent 8025d85019
commit 9672f90091

View File

@ -195,7 +195,9 @@ impl Loop {
/// otherwise waiting for the future to complete.
///
/// Returns the value that the future resolves to.
pub fn run<F: Future>(&mut self, f: F) -> Result<F::Item, F::Error> {
pub fn run<F>(&mut self, f: F) -> Result<F::Item, F::Error>
where F: Future + 'static,
{
let (tx_res, rx_res) = mpsc::channel();
let handle = self.handle();
self.add_loop_data(f.then(move |res| {