about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-27 11:12:28 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-30 14:08:40 -0700
commitacd48a2b3e7fcc0372f7718a2fac1cf80e03db95 (patch)
treebf57c82936ee2c1e1df23edd0a750ec6aa75021d /src/liballoc
parent14192d6df5cc714e5c9a3ca70b08f2514d977be2 (diff)
downloadrust-acd48a2b3e7fcc0372f7718a2fac1cf80e03db95.tar.gz
rust-acd48a2b3e7fcc0372f7718a2fac1cf80e03db95.zip
std: Standardize (input, output) param orderings
This functions swaps the order of arguments to a few functions that previously
took (output, input) parameters, but now take (input, output) parameters (in
that order).

The affected functions are:

* ptr::copy
* ptr::copy_nonoverlapping
* slice::bytes::copy_memory
* intrinsics::copy
* intrinsics::copy_nonoverlapping

Closes #22890
[breaking-change]
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/heap.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 3733350412e..c6c86e46b44 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -301,7 +301,7 @@ mod imp {
             libc::realloc(ptr as *mut libc::c_void, size as libc::size_t) as *mut u8
         } else {
             let new_ptr = allocate(size, align);
-            ptr::copy(new_ptr, ptr, cmp::min(size, old_size));
+            ptr::copy(ptr, new_ptr, cmp::min(size, old_size));
             deallocate(ptr, old_size, align);
             new_ptr
         }