title: What does it mean to pass in a vector into a `for` loop versus a reference to a vector?
body: <p>I'm confused by how Rust <code>for</code> loops work. Consider the following:</p>
  
  <pre><code>#![feature(core_intrinsics)]
  
  fn print_type_of&lt;T&gt;(_: T) {
      println!("{}", unsafe { std::intrinsics::type_name::&lt;T&gt;() });
  }
  
  fn main() {
      let nums = vec![1, 2, 3];
      for num in &amp;nums { print_type_of(num); }
      for num in  nums { print_type_of(num); }
  }
  </code></pre>
  
  <p>It outputs the following:</p>
  
  <pre><code>&amp;i32
  &amp;i32
  &amp;i32
  i32
  i32
  i32
  </code></pre>
  
  <p>What does it mean to pass in a vector into <code>for</code> versus a reference to a vector? Why, when you pass in a reference, do you get a reference to the items and when you pass in an actual vector, you get the actual items?</p>