title: "Expected type parameter" error in the constructor of a generic struct
body: <p>I am trying to store piston textures in a struct.</p>
  
  <pre><code>struct TextureFactory&lt;R&gt; where R: gfx::Resources {
      block_textures: Vec&lt;Rc&lt;Texture&lt;R&gt;&gt;&gt;,
  }
  
  impl&lt;R&gt; TextureFactory&lt;R&gt; where R: gfx::Resources  {
      fn new(window: PistonWindow) -&gt; Self {
          let texture = Rc::new(gfx_texture::Texture::from_path(
              &amp;mut *window.factory.borrow_mut(),
              "assets/element_red_square.png",
              Flip::None, &amp;TextureSettings::new()
          ).unwrap());
          let block_textures = Vec::new();
          block_textures.push(texture);
  
          TextureFactory {
              block_textures: block_textures,
          }
      }
  }
  </code></pre>
  
  <p>This does not compile:</p>
  
  <pre class="lang-none prettyprint-override"><code>src/main.rs:37:9: 39:10 error: mismatched types:
   expected `TextureFactory&lt;R&gt;`,
      found `TextureFactory&lt;gfx_device_gl::Resources&gt;`
  (expected type parameter,
      found enum `gfx_device_gl::Resources`)
  </code></pre>
  
  <p><code>gfx_device_gl::Resources</code> <a href="http://www.piston.rs/docs/piston_window/gfx/device/trait.Resources.html" rel="noreferrer">implements <code>gfx::Resources</code></a> though (I think it's just the device specific implementation.) I don't actually care what type this is, but I need to know so that I can store it in the struct.</p>
  
  <p>I made a <a href="https://github.com/xaviershay/rust-puzzlefighter/tree/repro" rel="noreferrer">compilable repo on Github</a>.</p>
  
  <p>(I suspect <a href="https://stackoverflow.com/questions/26063593/rust-generics-traits-expected-foob-found-foofoo2">Rust generics/traits: &quot;expected &#39;Foo&lt;B&gt;&#39;, found &#39;Foo&lt;Foo2&gt;&#39;&quot;</a> is the same question, but I can't figure out how to apply it to my problem.)</p>