about summary refs log tree commit diff
path: root/library/alloc/src/vec/in_place_drop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/alloc/src/vec/in_place_drop.rs')
-rw-r--r--library/alloc/src/vec/in_place_drop.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec/in_place_drop.rs b/library/alloc/src/vec/in_place_drop.rs
index 354d25c2389..1b1ef9130fa 100644
--- a/library/alloc/src/vec/in_place_drop.rs
+++ b/library/alloc/src/vec/in_place_drop.rs
@@ -10,7 +10,7 @@ pub(super) struct InPlaceDrop<T> {
 
 impl<T> InPlaceDrop<T> {
     fn len(&self) -> usize {
-        unsafe { self.dst.offset_from(self.inner) as usize }
+        unsafe { self.dst.sub_ptr(self.inner) }
     }
 }