1
Fork 0

Rollup merge of #22729 - alexcrichton:ptr-stabilization, r=aturon

Specifically, the following actions were takend:

* The `copy_memory` and `copy_nonoverlapping_memory` functions
  to drop the `_memory` suffix (as it's implied by the functionality). Both
  functions are now marked as `#[stable]`.
* The `set_memory` function was renamed to `write_bytes` and is now stable.
* The `zero_memory` function is now deprecated in favor of `write_bytes`
  directly.
* The `Unique` pointer type is now behind its own feature gate called `unique`
  to facilitate future stabilization.

[breaking-change]
This commit is contained in:
Manish Goregaokar 2015-02-25 10:29:46 +05:30
commit 6c6f2317ba
15 changed files with 126 additions and 122 deletions

View file

@ -155,9 +155,9 @@ impl<W: Write> BufWriter<W> {
if written > 0 {
// NB: would be better expressed as .remove(0..n) if it existed
unsafe {
ptr::copy_memory(self.buf.as_mut_ptr(),
self.buf.as_ptr().offset(written as isize),
len - written);
ptr::copy(self.buf.as_mut_ptr(),
self.buf.as_ptr().offset(written as isize),
len - written);
}
}
self.buf.truncate(len - written);