title: move occurs because value has type Vec<T>, which does not implement the `Copy` trait
body: <p>I am writing a very simple recursive program for finding all prime numbers between two numbers:</p>
  <pre><code>use std::cmp::PartialOrd;
  use std::ops::{Add, Div, Rem, Sub};
  
  fn _is_prime&lt;T&gt;(n: T, dividend: T, one: T) -&gt; bool
  where
      T: Copy + Rem&lt;Output = T&gt; + Sub&lt;Output = T&gt; + PartialOrd,
  {
      if dividend == one {
          true
      } else {
          if n % dividend &lt; one {
              false
          } else {
              _is_prime(n, dividend - one, one)
          }
      }
  }
  
  fn _primes_between&lt;'a, T&gt;(a: T, b: T, one: T, v: &amp;'a mut Vec&lt;T&gt;) -&gt; &amp;'a mut Vec&lt;T&gt;
  where
      T: Copy + Rem&lt;Output = T&gt; + Add&lt;Output = T&gt; + Sub&lt;Output = T&gt; + PartialOrd,
  {
      if a &lt;= b {
          if _is_prime(a, a - one, one) {
              v.push(a);
          }
  
          _primes_between(a + one, b, one, v)
      } else {
          v
      }
  }
  
  fn primes_between&lt;T&gt;(a: T, b: T) -&gt; Vec&lt;T&gt;
  where
      T: Copy + Div&lt;Output = T&gt; + Rem&lt;Output = T&gt; + Add&lt;Output = T&gt; + Sub&lt;Output = T&gt; + PartialOrd,
  {
      let one = a / a;
  
      let mut v: Vec&lt;T&gt; = Vec::new();
  
      *_primes_between(a, b, one, &amp;mut v)
  }
  
  fn main() {
      primes_between(3, 13).iter().for_each(|i| println!(&quot;{}&quot;, i));
  }
  
  </code></pre>
  <p>The problem is:</p>
  <pre class="lang-none prettyprint-override"><code>error[E0507]: cannot move out of a mutable reference
    --&gt; src/main.rs:42:5
     |
  42 |     *_primes_between(a, b, one, &amp;mut v)
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `std::vec::Vec&lt;T&gt;`, which does not implement the `Copy` trait
  </code></pre>
  <p>How do I solve that error?</p>