Skip to content

Commit

Permalink
Update library/alloc/src/vec/mod.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Ralf Jung <[email protected]>
  • Loading branch information
WaffleLapkin and RalfJung authored Mar 3, 2021
1 parent a1835bc commit 950f121
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ impl<T, A: Allocator> Vec<T, A> {

// SAFETY:
// - `ptr` is guaranteed to be valid for `len` elements
// - `spare_ptr` is pointing one element past the buffer, so it doesn't overlap with `initialized` slice
// - `spare_ptr` is pointing one element past the buffer, so it doesn't overlap with `initialized`
unsafe {
let initialized = slice::from_raw_parts_mut(ptr, self.len);
let spare = slice::from_raw_parts_mut(spare_ptr, spare_len);
Expand Down

0 comments on commit 950f121

Please sign in to comment.