Rollup merge of #30735 - jonastepe:nomicon_vec_dealloc_pointer_type, r=steveklabnik

heap::deallocate expects a *mut u8, but here a *mut T is given as the type of the argument. This would not compile. The final code is correct, however.
This commit is contained in:
Steve Klabnik 2016-01-06 18:31:58 -05:00
commit e78de13783

View File

@ -21,7 +21,7 @@ impl<T> Drop for Vec<T> {
let elem_size = mem::size_of::<T>();
let num_bytes = elem_size * self.cap;
unsafe {
heap::deallocate(*self.ptr, num_bytes, align);
heap::deallocate(*self.ptr as *mut _, num_bytes, align);
}
}
}