Lines Matching defs:l_len
114 /// The caller promises that `l_len` is not greater than the length of
136 unsafe fn split_at_unchecked(&self, l_len: usize) -> Split<&Self> {
137 // SAFETY: By precondition on the caller, `l_len <= self.len()`.
138 unsafe { Split::<&Self>::new(self, l_len) }
143 /// Returns `None` if `l_len` is greater than the length of `self`'s
198 fn split_at(&self, l_len: usize) -> Option<Split<&Self>> {
199 MetadataOf::new_in_bounds(self, l_len).map(
201 |l_len| {
202 // SAFETY: We have ensured that `l_len <= self.len()` (by
204 unsafe { Split::new(self, l_len.get()) }
213 /// The caller promises that `l_len` is not greater than the length of
221 unsafe fn split_at_mut_unchecked(&mut self, l_len: usize) -> Split<&mut Self> {
222 // SAFETY: By precondition on the caller, `l_len <= self.len()`.
223 unsafe { Split::<&mut Self>::new(self, l_len) }
228 /// Returns `None` if `l_len` is greater than the length of `self`'s
275 fn split_at_mut(&mut self, l_len: usize) -> Option<Split<&mut Self>> {
276 MetadataOf::new_in_bounds(self, l_len).map(
278 |l_len| {
279 // SAFETY: We have ensured that `l_len <= self.len()` (by
281 unsafe { Split::new(self, l_len.get()) }
345 /// If `source` is a pointer to a slice DST, `l_len` is no greater than
347 l_len: usize,
351 /// Produces a `Split` of `source` with `l_len`.
355 /// `l_len` is no greater than `source`'s length.
357 unsafe fn new(source: T, l_len: usize) -> Self {
358 Self { source, l_len }
370 // and thus maintains the invariants of `self` with respect to `l_len`.
371 unsafe { Split::new(source, self.l_len) }
683 // left and right portions of `self` split at `l_len` do not overlap.
697 // and thus maintains the invariants of `self` with respect to `l_len`.
698 unsafe { Split::new(source, self.l_len) }
922 // at `l_len` do not overlap.
939 // respect to `l_len`.
940 unsafe { Split::new(self.source.as_ref(), self.l_len) }
949 // respect to `l_len`.
950 unsafe { Split::new(self.source.unify_invariants().as_mut(), self.l_len) }
955 fn l_len(&self) -> MetadataOf<T> {
956 // SAFETY: By invariant on `Split`, `self.l_len` is not greater than the
958 unsafe { MetadataOf::<T>::new_unchecked(self.l_len) }
997 // `self.l_len()`, which is valid by `Split`'s invariant—describes an
1026 let l_len = self.l_len();
1027 // `l_len` witnesses an object size at most `isize::MAX`, and
1030 let trailing_padding = crate::trailing_slice_layout::<T>().padding_for_elems(l_len.get());
1052 let l_len = self.l_len();
1055 // SAFETY: By invariant on `Self::l_len`, `l_len` is not greater than
1057 let (left, right) = unsafe { inner.split_at_unchecked(l_len) };