Skip to content

Commit a9b1419

Browse files
committed
oepsje woepsje
1 parent 95eb76c commit a9b1419

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • library/alloc/src/collections/vec_deque

library/alloc/src/collections/vec_deque/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3655,7 +3655,7 @@ impl<T: Clone, A: Allocator> SpecExtendFromWithin for VecDeque<T, A> {
36553655
// SAFETY:
36563656
// - Ranges do not overlap: src entirely spans initialized values, dst entirely spans uninitialized values.
36573657
// - Ranges are in bounds: guaranteed by the caller.
3658-
let ranges = self.nonoverlapping_ranges(src, dst, count, new_head);
3658+
let ranges = unsafe { self.nonoverlapping_ranges(src, dst, count, new_head) };
36593659

36603660
// Cloning is done in reverse because we prepend to the front of the deque,
36613661
// we can't get holes in the *logical* buffer.
@@ -3693,7 +3693,8 @@ impl<T: Clone, A: Allocator> SpecExtendFromWithin for VecDeque<T, A> {
36933693
for offset in iter {
36943694
// SAFETY: Untriaged.
36953695
unsafe { dst.add(offset).write((*src.add(offset)).clone()) };
3696-
self.head = self.head.sub(1);
3696+
// SAFETY: Untriaged.
3697+
self.head = unsafe { self.head.sub(1) };
36973698
self.len += 1;
36983699
}
36993700
}

0 commit comments

Comments
 (0)