Fix inconsistent safety requirement in VecDeque::nonoverlapping_ranges

This commit is contained in:
Yilin Chen
2026-06-26 15:35:41 +08:00
parent 40557f6225
commit 58f80da065

View File

@@ -267,7 +267,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
///
/// - Ranges must not overlap: `src.abs_diff(dst) >= count`.
/// - Ranges must be in bounds of the logical buffer: `src + count <= self.capacity()` and `dst + count <= self.capacity()`.
/// - `head` must be in bounds: `head < self.capacity()`.
/// - `head` must be in bounds: `head < self.capacity()`, unless `self.capacity() == 0`, in which case `head == 0`.
#[cfg(not(no_global_oom_handling))]
unsafe fn nonoverlapping_ranges(
&mut self,