From 993fb934640b7e514f3c629c33a2698a83ed8c3e Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 19 Aug 2018 22:16:22 -0400 Subject: Replace usages of ptr::offset with ptr::{add,sub}. --- src/libstd/sys_common/wtf8.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd/sys_common') 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 )) } -- cgit 1.4.1-3-g733a5