title: Where is Clone implemented for [u32; N]?
body: <p>I have a struct that I want to implement <code>.clone_from()</code> for to reuse a stack allocation. The struct is relatively simple (all types in it are <code>Copy</code> except a <code>[u32; N]</code>). I could blindly just call <code>a.clone_from(&amp;b)</code> on the <code>a : [u32; N]</code>, but it is possible that the <code>.clone_from()</code> implementation for this type in the standard library is not good, and that this will compute <code>let a = b.clone()</code>, and will not reuse the stack allocation.</p>
  <p>So, I want to look at the Clone implementation of arrays myself to make sure, but I am having difficulty finding it within the nightly docs. I have looked in:</p>
  <ol>
  <li><p>The <a href="https://doc.rust-lang.org/std/clone/trait.Clone.html" rel="nofollow noreferrer">clone doc page</a> and <a href="https://doc.rust-lang.org/src/core/clone.rs.html#107-131" rel="nofollow noreferrer">clone source</a>. I see nothing like <code>impl &lt;const N : usize&gt; Clone for [T; N]</code> in either of these places</p>
  </li>
  <li><p>The <a href="https://doc.rust-lang.org/std/primitive.array.html" rel="nofollow noreferrer">array (primitive type)</a> and <a href="https://doc.rust-lang.org/src/core/array/mod.rs.html#406-509" rel="nofollow noreferrer">array source</a>, where again I see no implementation.</p>
  </li>
  </ol>
  <p>So where is the implementation? How can I check that calling <code>a.clone_from(&amp;b)</code> will reuse my allocation?</p>