diff options
| author | bors <bors@rust-lang.org> | 2018-08-21 16:04:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-21 16:04:11 +0000 |
| commit | 9f9f2c0095cd683b94adca133f2733aa1f88bb19 (patch) | |
| tree | 633b85f8126a21ae60807bede94f1c57c5167a6a /src/liballoc/string.rs | |
| parent | a9d496796f091f42c8bac60c5c9ca05e6ca5dcda (diff) | |
| parent | e3887e6c8afbaafe0332e9776199bc89030e227b (diff) | |
| download | rust-9f9f2c0095cd683b94adca133f2733aa1f88bb19.tar.gz rust-9f9f2c0095cd683b94adca133f2733aa1f88bb19.zip | |
Auto merge of #53530 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests
Successful merges:
- #53030 (Updated RELEASES.md for 1.29.0)
- #53104 (expand the documentation on the `Unpin` trait)
- #53213 (Stabilize IP associated constants)
- #53296 (When closure with no arguments was expected, suggest wrapping)
- #53329 (Replace usages of ptr::offset with ptr::{add,sub}.)
- #53363 (add individual docs to `core::num::NonZero*`)
- #53370 (Stabilize macro_vis_matcher)
- #53393 (Mark libserialize functions as inline)
- #53405 (restore the page title after escaping out of a search)
- #53452 (Change target triple used to check for lldb in build-manifest)
- #53462 (Document Box::into_raw returns non-null ptr)
- #53465 (Remove LinkMeta struct)
- #53492 (update lld submodule to include RISCV patch)
- #53496 (Fix typos found by codespell.)
- #53521 (syntax: Optimize some literal parsing)
- #53540 (Moved issue-53157.rs into src/test/ui/consts/const-eval/)
- #53551 (Avoid some Place clones.)
Failed merges:
r? @ghost
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index dd559df08cc..eabda7123de 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1190,8 +1190,8 @@ impl String { let next = idx + ch.len_utf8(); let len = self.len(); unsafe { - ptr::copy(self.vec.as_ptr().offset(next as isize), - self.vec.as_mut_ptr().offset(idx as isize), + ptr::copy(self.vec.as_ptr().add(next), + self.vec.as_mut_ptr().add(idx), len - next); self.vec.set_len(len - (next - idx)); } @@ -1232,8 +1232,8 @@ impl String { del_bytes += ch_len; } else if del_bytes > 0 { unsafe { - ptr::copy(self.vec.as_ptr().offset(idx as isize), - self.vec.as_mut_ptr().offset((idx - del_bytes) as isize), + ptr::copy(self.vec.as_ptr().add(idx), + self.vec.as_mut_ptr().add(idx - del_bytes), ch_len); } } @@ -1289,11 +1289,11 @@ impl String { let amt = bytes.len(); self.vec.reserve(amt); - ptr::copy(self.vec.as_ptr().offset(idx as isize), - self.vec.as_mut_ptr().offset((idx + amt) as isize), + ptr::copy(self.vec.as_ptr().add(idx), + self.vec.as_mut_ptr().add(idx + amt), len - idx); ptr::copy(bytes.as_ptr(), - self.vec.as_mut_ptr().offset(idx as isize), + self.vec.as_mut_ptr().add(idx), amt); self.vec.set_len(len + amt); } |
