title: Why can I iterate over a slice twice, but not a vector?
body: <p>If I try to iterate over a slice twice, <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=7b4313e5761bada577e05898d4b2d939" rel="noreferrer">it works fine</a>:</p>
  
  <pre><code>let a = &amp;[1, 2, 3];
  for i in a {
      println!("{}", i);
  }
  for i in a {            // works fine
      println!("{}", i);
  }
  </code></pre>
  
  <p>If I try to iterate over a vector twice, <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8a6a75b612cff35956263b8225a2868b" rel="noreferrer">it fails</a>:</p>
  
  <pre><code>let a = vec![1, 2, 3];
  for i in a {
      println!("{}", i);
  }
  for i in a {
      println!("{}", i);
  }
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>error[E0382]: use of moved value: `a`
   --&gt; src/main.rs:6:14
    |
  3 |     for i in a {
    |              - value moved here
  ...
  6 |     for i in a {
    |              ^ value used here after move
    |
    = note: move occurs because `a` has type `std::vec::Vec&lt;i32&gt;`, which does not implement the `Copy` trait
  </code></pre>
  
  <p>I see that the <a href="https://doc.rust-lang.org/std/iter/trait.IntoIterator.html" rel="noreferrer"><code>IntoIterator</code></a> trait takes <code>self</code> by value, so it makes sense to me that the second example fails. Why does the first example succeed?</p>