title: How to initialize struct fields which reference each other
body: <p>I currently want to define a struct for a <a href="https://github.com/PistonDevelopers/piston" rel="noreferrer" title="Piston">Piston</a> game using GamerIterator:</p>
  
  <pre class="lang-rust prettyprint-override"><code>pub struct MyGame&lt;'a&gt; {
      game_window: GameWindowGLFW,
      game_iter: GameIterator&lt;'a, GameWindowGLFW&gt;,
      //...
  }
  </code></pre>
  
  <p>The <code>GameIterator</code> is generic in the <code>GameWindow</code> and its lifetime. I want to tell the compiler that it has the same lifetime as the field "game_window"/"the whole struct" and leave out the lifetime for the struct.</p>
  
  <p>I also have difficulties initializing this:</p>
  
  <pre><code>MyGame {
      game_window: GameWindowGLFW::new(GameWindowSettings {/*...*/},
      game_iter: GameIterator::new(&amp;mut game_window, &amp;game_iter_settings), // game_window cannot be used here
      //...
  }
  </code></pre>
  
  <p>I think that I can work around the initialization issue by using <code>Option&lt;GameIterator&lt;...&gt;&gt;</code> and an init() method, but I would like to avoid this because I can guarantee that <code>game_iter</code> is present after <code>new()</code> finishes.</p>
  
  <p>What is the idiomatic way to write this?</p>