diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-27 11:12:28 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-30 14:08:40 -0700 |
| commit | acd48a2b3e7fcc0372f7718a2fac1cf80e03db95 (patch) | |
| tree | bf57c82936ee2c1e1df23edd0a750ec6aa75021d /src/libcoretest | |
| parent | 14192d6df5cc714e5c9a3ca70b08f2514d977be2 (diff) | |
| download | rust-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/libcoretest')
| -rw-r--r-- | src/libcoretest/ptr.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libcoretest/ptr.rs b/src/libcoretest/ptr.rs index bdb56c9f867..8f1017c50a3 100644 --- a/src/libcoretest/ptr.rs +++ b/src/libcoretest/ptr.rs @@ -35,18 +35,15 @@ fn test() { let v0 = vec![32000u16, 32001u16, 32002u16]; let mut v1 = vec![0u16, 0u16, 0u16]; - copy(v1.as_mut_ptr().offset(1), - v0.as_ptr().offset(1), 1); + copy(v0.as_ptr().offset(1), v1.as_mut_ptr().offset(1), 1); assert!((v1[0] == 0u16 && v1[1] == 32001u16 && v1[2] == 0u16)); - copy(v1.as_mut_ptr(), - v0.as_ptr().offset(2), 1); + copy(v0.as_ptr().offset(2), v1.as_mut_ptr(), 1); assert!((v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 0u16)); - copy(v1.as_mut_ptr().offset(2), - v0.as_ptr(), 1); + copy(v0.as_ptr(), v1.as_mut_ptr().offset(2), 1); assert!((v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 32000u16)); |
