title: "Expected lifetime parameter" error in minimal futures callback example?
body: <p>I'm trying to build a <a href="https://play.rust-lang.org/?gist=bdabc0eb791d3db36faa3a0f7104f20d&amp;version=stable&amp;mode=debug&amp;edition=2015" rel="nofollow noreferrer">very basic example of an asynchronous callback function in Rust</a>:</p>
  
  <pre><code>extern crate tokio;
  extern crate tokio_core;
  extern crate tokio_io;
  
  use std::error::Error;
  use tokio::prelude::future::ok;
  use tokio::prelude::Future;
  
  fn async_op() -&gt; impl Future&lt;Item = i32, Error = Box&lt;Error&gt;&gt; {
      ok(12)
  }
  
  fn main() {
      let fut = async_op().and_then(|result| {
          println!("result: {:?}", result);
      });
      tokio::run(fut);
  }
  </code></pre>
  
  <p>This always results in the compiler error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0106]: missing lifetime specifier
   --&gt; src/main.rs:9:54
    |
  9 | fn async_op() -&gt; impl Future&lt;Item = i32, Error = Box&lt;Error&gt;&gt; {
    |                                                      ^^^^^ expected lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
    = help: consider giving it a 'static lifetime
  </code></pre>
  
  <p>Why is there a lifetime error in the first place? Why is it only for the <code>Error</code> but not for the <code>Item</code>?</p>
  
  <p>I am also unsure about "help: consider giving it a 'static lifetime" ‒ AFAICT this would result in a lifetime of the return value over the entire program execution, which is definitely not what I would want in a more complex example.</p>