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/test | |
| 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/test')
| -rw-r--r-- | src/test/bench/shootout-fasta-redux.rs | 5 | ||||
| -rw-r--r-- | src/test/bench/shootout-reverse-complement.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/test/bench/shootout-fasta-redux.rs b/src/test/bench/shootout-fasta-redux.rs index 709b23ef9dd..7c4cc0eaab7 100644 --- a/src/test/bench/shootout-fasta-redux.rs +++ b/src/test/bench/shootout-fasta-redux.rs @@ -126,10 +126,9 @@ impl<'a, W: Writer> RepeatFasta<'a, W> { let mut buf = repeat(0).take(alu_len + LINE_LEN).collect::<Vec<_>>(); let alu: &[u8] = self.alu.as_bytes(); - copy_memory(&mut buf, alu); + copy_memory(alu, &mut buf); let buf_len = buf.len(); - copy_memory(&mut buf[alu_len..buf_len], - &alu[..LINE_LEN]); + copy_memory(&alu[..LINE_LEN], &mut buf[alu_len..buf_len]); let mut pos = 0; let mut bytes; diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs index 82ea234f6dd..cda90c08f23 100644 --- a/src/test/bench/shootout-reverse-complement.rs +++ b/src/test/bench/shootout-reverse-complement.rs @@ -181,8 +181,8 @@ fn reverse_complement(seq: &mut [u8], tables: &Tables) { let mut i = LINE_LEN; while i < len { unsafe { - copy(seq.as_mut_ptr().offset((i - off + 1) as isize), - seq.as_ptr().offset((i - off) as isize), off); + copy(seq.as_ptr().offset((i - off) as isize), + seq.as_mut_ptr().offset((i - off + 1) as isize), off); *seq.get_unchecked_mut(i - off) = b'\n'; } i += LINE_LEN + 1; diff --git a/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs b/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs index e013c5b0be7..7cc762c9348 100644 --- a/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs +++ b/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs @@ -26,7 +26,7 @@ trait MyWriter { impl<'a> MyWriter for &'a mut [u8] { fn my_write(&mut self, buf: &[u8]) -> IoResult<()> { - slice::bytes::copy_memory(*self, buf); + slice::bytes::copy_memory(buf, *self); let write_len = buf.len(); unsafe { |
