about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-08-21 22:05:30 +0800
committerkennytm <kennytm@gmail.com>2018-08-21 22:05:30 +0800
commit0dd88c97975b2a2e4ea3e4a2bdc3670a9f40bd67 (patch)
tree0ad62b121fcafe2d11ee95819caf64e975d4ad00 /src/libstd/sys_common
parent9bbab65ebefbeb512445a759603b03f858e5e9b9 (diff)
parent993fb934640b7e514f3c629c33a2698a83ed8c3e (diff)
downloadrust-0dd88c97975b2a2e4ea3e4a2bdc3670a9f40bd67.tar.gz
rust-0dd88c97975b2a2e4ea3e4a2bdc3670a9f40bd67.zip
Rollup merge of #53329 - frewsxcv:frewsxcv-ptr-add-sub, r=RalfJung
Replace usages of ptr::offset with ptr::{add,sub}.

Rust provides these helper methods – so let's use them!
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/wtf8.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs
index 45204b56ead..8725abe7416 100644
--- a/src/libstd/sys_common/wtf8.rs
+++ b/src/libstd/sys_common/wtf8.rs
@@ -772,7 +772,7 @@ pub fn is_code_point_boundary(slice: &Wtf8, index: usize) -> bool {
 pub unsafe fn slice_unchecked(s: &Wtf8, begin: usize, end: usize) -> &Wtf8 {
     // memory layout of an &[u8] and &Wtf8 are the same
     Wtf8::from_bytes_unchecked(slice::from_raw_parts(
-        s.bytes.as_ptr().offset(begin as isize),
+        s.bytes.as_ptr().add(begin),
         end - begin
     ))
 }