Skip to content

Commit

Permalink
Rollup merge of rust-lang#30735 - jonastepe:nomicon_vec_dealloc_point…
Browse files Browse the repository at this point in the history
…er_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.
  • Loading branch information
steveklabnik committed Jan 6, 2016
2 parents d91518b + eb30c66 commit e78de13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/nomicon/vec-dealloc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit e78de13

Please sign in to comment.