title: How can I write data from a slice to the same slice?
body: <p>I want to write the end of a slice to the top of the same slice.</p>
  
  <pre><code>let mut foo = [1, 2, 3, 4, 5];
  
  foo[..2].copy_from_slice(&amp;[4..]); // error: multiple references to same data (mut and not)
  
  assert!(foo, [4, 5, 3, 4, 5]);
  </code></pre>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/36244762/how-to-operate-on-2-mutable-slices-of-a-rust-array">How to operate on 2 mutable slices of a Rust array</a> </p>
  
  <p>I want the maximum performance possible (for example, by using <code>foo.as_ptr()</code>).</p>