title: Borrow in filter closure does not live long enough
body: <p>When I try to compile this code (<a href="https://play.rust-lang.org/?gist=a06dc16f4149afd0c31d960b05fa958b&amp;version=stable&amp;backtrace=0" rel="nofollow noreferrer">playground</a>):</p>
  
  <pre><code>fn main() {
      let iter = "abc123".chars().filter(&amp;|&amp;c: &amp;char| c.is_digit(10));
      match iter.clone().take(3).count() {
          3 =&gt; println!("{}", iter.collect::&lt;String&gt;()),
          _ =&gt; {}
      }
  }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: borrowed value does not live long enough
   --&gt; test.rs:2:41
    |
  2 |     let iter = "abc123".chars().filter(&amp;|c: &amp;char| c.is_digit(10));
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^ - temporary value only lives until here
    |                                         |
    |                                         temporary value created here
  ...
  7 | }
    | - temporary value needs to live until here
    |
    = note: consider using a `let` binding to increase its lifetime
  </code></pre>
  
  <p>I understand that the error is helpfully telling me to declare the closure in the line above with <code>let f = &amp;|c: &amp;char| c.is_digit(10);</code> (<a href="https://play.rust-lang.org/?code=fn%20main()%20%7B%0A%20%20%20%20let%20f%20%3D%20%26%7Cc%3A%20%26char%7C%20c.is_digit(10)%3B%0A%20%20%20%20let%20iter%20%3D%20%22abc123%22.chars().filter(f)%3B%0A%20%20%20%20match%20iter.clone().take(3).count()%20%7B%0A%20%20%20%20%20%20%20%203%20%3D%3E%20println!(%22%7B%7D%22%2C%20iter.collect%3A%3A%3CString%3E())%2C%0A%20%20%20%20%20%20%20%20_%20%3D%3E%20%7B%7D%2C%0A%20%20%20%20%7D%0A%7D%0A&amp;version=stable&amp;backtrace=0" rel="nofollow noreferrer">working code</a>), but why exactly is this necessary? </p>
  
  <p>I'm also not sure why the closure has to contain two references - <code>&amp;|c: &amp;char|</code>. Doesn't <code>"abc123".chars()</code> simply create an iterator of chars?</p>