We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d04e6b8 commit d9e877fCopy full SHA for d9e877f
library/alloc/src/collections/vec_deque.rs
@@ -1086,7 +1086,9 @@ impl<T> VecDeque<T> {
1086
where
1087
R: RangeBounds<usize>,
1088
{
1089
- // SAFETY: This buffer is only used to check the range.
+ // SAFETY: This buffer is only used to check the range. It might be partially
1090
+ // uninitialized, but `check_range` needs a contiguous slice.
1091
+ // https://github.com/rust-lang/rust/pull/75207#discussion_r471193682
1092
let buffer = unsafe { slice::from_raw_parts(self.ptr(), self.len()) };
1093
let Range { start, end } = buffer.check_range(range);
1094
let tail = self.wrap_add(self.tail, start);
0 commit comments