diff options
Diffstat (limited to 'library/alloc/src/slice.rs')
| -rw-r--r-- | library/alloc/src/slice.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index 5bdf36a63a2..199b3c9d029 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -1056,7 +1056,7 @@ where fn drop(&mut self) { // `T` is not a zero-sized type, and these are pointers into a slice's elements. unsafe { - let len = self.end.offset_from(self.start) as usize; + let len = self.end.sub_ptr(self.start); ptr::copy_nonoverlapping(self.start, self.dest, len); } } |
