title: Implement Iterator trait for a struct containing an iterable field
body: <p>I want to implement the <code>Iterator</code> trait for a struct which contains an iterable field. Iterating over my struct should yield the same results obtained iterating over the field. This is what I'd like to have (obviously not working):</p>
  <pre class="lang-rs prettyprint-override"><code>struct Foo {
      bar: Vec&lt;char&gt;,
  }
  
  impl Iterator for Foo {
      type Item: &amp;char; // Error: expected named lifetime parameter
      
      fn next(&amp;mut self) -&gt; Option&lt;Self::Item&gt; {
          self.bar.iter().next()
      }
  }
  </code></pre>
  <p>To avoid that error I tried to insert lifetimes:</p>
  <pre class="lang-rs prettyprint-override"><code>use std::marker::PhantomData;
  
  struct Foo&lt;'a&gt; {
      bar: Vec&lt;char&gt;,
      phantom: &amp;'a PhantomData&lt;char&gt; // not sure what to put inside &lt; .. &gt;
  }
  
  impl&lt;'a&gt; Iterator for Foo&lt;'a&gt; {
      type Item = &amp;'a char;
  
      fn next(&amp;mut self) -&gt; Option&lt;Self::Item&gt; {
          self.bar.iter().next() // again, several errors about lifetimes
      }
  }
  </code></pre>
  <p>How do I implement the <code>Iterator</code> trait for such a struct?</p>