We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4184396 commit f14cb96Copy full SHA for f14cb96
src/libcollections/vec.rs
@@ -848,7 +848,11 @@ impl<T> Vec<T> {
848
let ptr = self.ptr;
849
let cap = self.cap;
850
let begin = self.ptr as *const T;
851
- let end = (self.ptr as uint + self.len()) as *const T;
+ let end = if mem::size_of::<T>() == 0 {
852
+ (ptr as uint + self.len()) as *const T;
853
+ } else {
854
+ ptr.offset(self.len() as int)
855
+ };
856
mem::forget(self);
857
MoveItems { allocation: ptr, cap: cap, ptr: begin, end: end }
858
}
0 commit comments