title: Use of undeclared type name error with a parameterized trait
body: <p>I'm trying to implement a few operations on a parameterized type (specifically, some common "stack" operations on top of <code>Vec&lt;T&gt;</code>. However I'm not sure how that works (yet), so here's a stripped-down version of what I'm currently struggling with:</p>
  
  <pre><code>trait Stack&lt;T&gt; {
      fn top(&amp;self) -&gt; Option&lt;T&gt;;
  }
  
  impl Stack for Vec&lt;T&gt; {
      fn top&lt;T&gt;(&amp;self) -&gt; Option&lt;T&gt; {
          match self.len() {
              0 =&gt; None,
              n =&gt; Some(self[n-1])
          }
      }
  }
  
  fn main() {
      let mut stack: Vec&lt;f64&gt; = Vec::new();
      stack.push(1324.4);
      println!("{}", stack.top());
  }
  </code></pre>
  
  <p>The above fails to compile (on rust nightly) with the following error:</p>
  
  <pre><code>test.rs:6:20: 6:21 error: use of undeclared type name `T`
  test.rs:6 impl Stack for Vec&lt;T&gt; {
                               ^
  error: aborting due to previous error
  </code></pre>