title: About trait Index implement of Vector in Rust
body: <p>I check Index trait in doc and find return type of <code>index()</code> is <code>&amp;T</code>. </p>
  
  <p>Then I write this function to get value from vector:</p>
  
  <pre><code>fn get_value_test(a: usize, v: &amp;Vec&lt;i32&gt;) -&gt; i32 {
      v[a]
  }
  </code></pre>
  
  <p>My question is: why <code>v[a]</code> is <code>i32</code> but <code>&amp;i32</code>? Because <code>i32</code> <code>...have a known size at compile time are stored entirely on the stack, so copies of the actual values are quick to make</code>? (from <a href="https://doc.rust-lang.org/book/second-edition/ch04-01-what-is-ownership.html" rel="nofollow noreferrer">here</a>)</p>
  
  <p>It looks like Rust have hidden rule to convert type in this situation?</p>