Tobias Müller <[email protected]> wrote: > Walter Bright > But if you still wanted a memcpy it would probably look like this: > > fn memcpy<'a, T>(dest: &'a mut [T], src: &[T]) -> &'a mut [T]
No, sorry: fn memcpy<'a, T: Copy>(dest: &'a mut [T], src: &[T]) -> &'a mut [T] And mutable references can never alias, you have the same guarantees as with _restrict, statically checked even at the call site.
