Lines Matching +full:non +full:- +full:safety
1 // SPDX-License-Identifier: Apache-2.0 OR MIT
48 // for both ZST and non-ZST.
53 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt()
71 pub fn as_slice(&self) -> &[T] { in as_slice()
89 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice()
96 pub fn allocator(&self) -> &A { in allocator()
100 fn as_raw_mut_slice(&mut self) -> *mut [T] { in as_raw_mut_slice()
117 /// This method is used by in-place iteration, refer to the vec::in_place_collect
147 pub(crate) fn into_vecdeque(self) -> VecDeque<T, A> { in into_vecdeque()
151 // SAFETY: This allocation originally came from a `Vec`, so it passes in into_vecdeque()
153 // so the `sub_ptr`s below cannot wrap, and will produce a well-formed in into_vecdeque()
154 // range. `end` ≤ `buf + cap`, so the range will be in-bounds. in into_vecdeque()
175 fn as_ref(&self) -> &[T] { in as_ref()
190 fn next(&mut self) -> Option<T> { in next()
209 fn size_hint(&self) -> (usize, Option<usize>) { in size_hint()
219 fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize> { in advance_by()
226 // SAFETY: the min() above ensures that step_size is in bounds in advance_by()
229 // SAFETY: the min() above ensures that step_size is in bounds in advance_by()
233 NonZeroUsize::new(n - step_size).map_or(Ok(()), Err) in advance_by()
237 fn count(self) -> usize { in count()
242 fn next_chunk<const N: usize>(&mut self) -> Result<[T; N], core::array::IntoIter<T, N>> { in next_chunk()
250 // Safety: ZSTs can be conjured ex nihilo, only the amount has to be correct
255 // Safety: ditto
260 … // Safety: `len` indicates that this many elements are available and we just checked that
269 // Safety: `len` is larger than the array size. Copy a fixed amount here to fully initialize
278 unsafe fn __iterator_get_unchecked(&mut self, i: usize) -> Self::Item in __iterator_get_unchecked()
282 // SAFETY: the caller must guarantee that `i` is in bounds of the in __iterator_get_unchecked()
299 fn next_back(&mut self) -> Option<T> { in next_back()
316 fn advance_back_by(&mut self, n: usize) -> Result<(), NonZeroUsize> { in advance_back_by()
319 // SAFETY: same as for advance_by() in advance_back_by()
322 // SAFETY: same as for advance_by() in advance_back_by()
326 // SAFETY: same as for advance_by() in advance_back_by()
330 NonZeroUsize::new(n - step_size).map_or(Ok(()), Err) in advance_back_by()
336 fn is_empty(&self) -> bool { in is_empty()
360 fn default() -> Self { in default()
371 // and thus we can't implement drop-handling
390 fn clone(&self) -> Self { in clone()
394 fn clone(&self) -> Self { in clone()
424 // In addition to the SAFETY invariants of the following three unsafe traits
436 unsafe fn as_inner(&mut self) -> &mut Self::Source { in as_inner()
445 fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item> { in as_into_iter()