diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 786d1b6ba82..2ff82a5dd3f 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -2705,7 +2705,7 @@ impl Iterator for IntoIter { // purposefully don't use 'ptr.offset' because for // vectors with 0-size elements this would return the // same pointer. - self.ptr = arith_offset(self.ptr as *const i8, 1) as *mut T; + self.ptr = arith_offset(self.ptr as *const T, 1) as *mut T; // Make up a value of this ZST. Some(mem::zeroed())