title: Rust type error when implementing Iterator
body: <p>I'm trying to generalize <code>.split</code> from slices to iterators, and I can't seem to get the types right. This is partially because I'm not very experienced with Rust, and partially because the error message is weirdly vague for what I've seen from Rust. I've included what I believe are the relevant snippets, but there's also a trait <code>Splittable</code> and an implementation for it. The errors (I believe the second error is caused by the first, please tell me if that's not correct):</p>
  <pre class="lang-rust prettyprint-override"><code>struct Split&lt;I: Iterator, P: Fn(&amp;I::Item) -&gt; bool&gt; {
      iter: I,
      pred: P,
  }
  
  impl&lt;I: Iterator, P: Fn(&amp;I::Item) -&gt; bool&gt; Iterator for Split&lt;I, P&gt; {
      type Item = Vec&lt;I::Item&gt;;
      fn next(&amp;mut self) -&gt; Option&lt;Self::Item&gt; {
          self.iter
              .cloned()
              .position(|x| (self.pred)(&amp;x))
              .map(|i| self.iter.take(i))
      }
  }
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>error[E0271]: type mismatch resolving `&lt;I as std::iter::Iterator&gt;::Item == &amp;_`
    --&gt; src/main.rs:13:14
     |
  13 |             .cloned()
     |              ^^^^^^ expected associated type, found reference
     |
     = note: expected associated type `&lt;I as std::iter::Iterator&gt;::Item`
                      found reference `&amp;_`
     = note: consider constraining the associated type `&lt;I as std::iter::Iterator&gt;::Item` to `&amp;_` or calling a method that returns `&lt;I as std::iter::Iterator&gt;::Item`
     = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
  
  error[E0599]: no method named `position` found for struct `std::iter::Cloned&lt;I&gt;` in the current scope
     --&gt; src/main.rs:14:14
      |
  14  |               .position(|x| (self.pred)(&amp;x))
      |                ^^^^^^^^ method not found in `std::iter::Cloned&lt;I&gt;`
      |
      = note: the method `position` exists but the following trait bounds were not satisfied:
              `&lt;I as std::iter::Iterator&gt;::Item = &amp;_`
              which is required by `std::iter::Cloned&lt;I&gt;: std::iter::Iterator`
  </code></pre>