title: Return type of .peekable() isn't Peekable<T>
body: <p>I'm trying to compile the following code with Rust version 1.22.1:</p>
  
  <pre><code>use std::str::Split;
  use std::iter::Peekable;
  
  // This is fine...
  fn tokenize&lt;'a&gt;(code: &amp;'a str) -&gt; Split&lt;'a, fn(char) -&gt; bool&gt; {
      code.split(char::is_whitespace)
  }
  
  // ...but this is not...
  fn tokenize_peekable_bad&lt;'a&gt;(code: &amp;'a str) -&gt; Peekable&lt;Split&lt;'a, fn(char) -&gt; bool&gt;&gt; {
      code.split(char::is_whitespace).peekable()
  }
  
  // ...however this is?
  fn tokenize_peekable&lt;'a&gt;(code: &amp;'a str) -&gt; Peekable&lt;Split&lt;'a, fn(char) -&gt; bool&gt;&gt; {
      tokenize(&amp;code).peekable()
  }
  </code></pre>
  
  <p>It seems to me that <code>tokenize_peekable_bad</code> and <code>tokenize_peekable</code> should have the exact same type signature, but <code>tokenize_peekable_bad</code> gives a compiler error while <code>tokenize_peekable</code> is just fine.</p>
  
  <p>The error is </p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0308]: mismatched types
    --&gt; src/main.rs:11:5
     |
  11 |     code.split(char::is_whitespace).peekable()
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item
     |
     = note: expected type `std::iter::Peekable&lt;std::str::Split&lt;'a, fn(char) -&gt; bool&gt;&gt;`
                found type `std::iter::Peekable&lt;std::str::Split&lt;'_, fn(char) -&gt; bool {std::char::&lt;impl char&gt;::is_whitespace}&gt;&gt;`
  </code></pre>
  
  <p>Can someone explain this puzzling result?</p>