Lines Matching defs:for

3 //! Utilities for the slice primitive type.
79 // HACK(japaric) needed for the implementation of `vec!` macro during testing
80 // N.B., see the `hack` module in this file for more details.
84 // HACK(japaric) needed for the implementation of `Vec::clone` during testing
85 // N.B., see the `hack` module in this file for more details.
91 // `core::slice::SliceExt` - we need to supply these functions for the
100 // `vec!` macro mostly and causes perf regression. See #71204 for
124 impl<T: Clone> ConvertVec for T {
131 impl<'a, T, A: Allocator> Drop for DropGuard<'a, T, A> {
144 // .take(slots.len()) is necessary for LLVM to remove bounds checks
146 for (i, b) in s.iter().enumerate().take(slots.len()) {
161 impl<T: Copy> ConvertVec for T {
194 /// Also, it allocates temporary storage half the size of `self`, but for short slices a
220 /// The comparator function must define a total ordering for the elements in the slice. If
222 /// total order if it is (for all `a`, `b` and `c`):
225 /// * transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
247 /// Also, it allocates temporary storage half the size of `self`, but for short slices a
292 /// Also, it allocates temporary storage half the size of `self`, but for short slices a
359 // Helper macro for indexing our vector by the smallest possible type, to reduce allocation.
368 for i in 0..$slice.len() {
442 // N.B., see the `hack` module in this file for more details.
464 // N.B., see the `hack` module in this file for more details.
652 // Extension traits for slices over specific kinds of data
655 /// Helper trait for [`[T]::concat`](slice::concat).
665 /// 608 | impl<T: Clone, V: Borrow<[T]>> Concat for [V] {
676 /// impl std::borrow::Borrow<[u32]> for Foo {
680 /// impl std::borrow::Borrow<[String]> for Foo {
695 /// Helper trait for [`[T]::join`](slice::join)
709 impl<T: Clone, V: Borrow<[T]>> Concat<T> for [V] {
715 for v in slice {
724 impl<T: Clone, V: Borrow<[T]>> Join<&T> for [V] {
737 for v in iter {
747 impl<T: Clone, V: Borrow<[T]>> Join<&[T]> for [V] {
761 for v in iter {
770 // Standard trait implementations for slices
774 impl<T, A: Allocator> Borrow<[T]> for Vec<T, A> {
781 impl<T, A: Allocator> BorrowMut<[T]> for Vec<T, A> {
787 // Specializable trait for implementing ToOwned::clone_into. This is
796 impl<T: Clone, A: Allocator> SpecCloneIntoVec<T, A> for [T] {
812 impl<T: Copy, A: Allocator> SpecCloneIntoVec<T, A> for [T] {
821 impl<T: Clone> ToOwned for [T] {