title: Any way to get associated type from struct?
body: <p>This code:</p>
  
  <pre><code>use std::collections::HashMap;
  
  struct MyNode;
  struct MyEdge;
  
  struct Graph&lt;N, E&gt; {
      h: HashMap&lt;N, Vec&lt;E&gt;&gt;,
  }
  
  type MyGraph = Graph&lt;MyNode, MyEdge&gt;;
  
  fn main() {
  
      let x: MyGraph::N;//XXX
  
      println!("Results:")
  
  }
  </code></pre>
  
  <p>Fails to compile with the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0223]: ambiguous associated type
    --&gt; /home/xxx/.emacs.d/rust-playground/at-2017-07-26-164119/snippet.rs:21:12
     |
  21 |     let x: MyGraph::N;
     |            ^^^^^^^^^^ ambiguous associated type
     |
     = note: specify the type using the syntax `&lt;Graph&lt;MyNode, MyEdge&gt; as Trait&gt;::N`
  </code></pre>
  
  <p>Is there any way to get <code>N</code> type from <code>Graph&lt;MyNode, MyEdge&gt;</code>?</p>
  
  <p>I created an alias (<code>type =</code>) to not duplicate node type definitions,
  so it would be great at the point marked <code>XXX</code> I could write not <code>let x: MyNode</code>but <code>let x: expression with MyGraph as argument</code>.</p>