Lines Matching refs:with

1549 /// Contrast range_unbounded_unbounded with `iter()`.
1583 // Benchmarks on it have a counterpart in set.rs with the same keys and no values at all.
3323 // Exercise is_dangling() with a DST
3334 // Exercise is_dangling() with a DST
4545 // Note that there are subtleties with the number of backslashes
4547 // are usually escaped with two backslashes on the right-hand side, as
5378 with $fwd:expr, $bwd:expr;
5402 with $fwd:expr;
5423 with str::split, str::rsplit;
5430 with str::split_terminator, str::rsplit_terminator;
5437 with str::matches, str::rmatches;
5444 with str::match_indices, str::rmatch_indices;
5451 with str::splitn;
5458 with str::rsplitn;
6311 // Any platform that succeeds for these requests is technically broken with
6356 // Same basic idea, but with non-zero len
6388 // This is exactly the same as test_try_reserve with the method changed.
7990 // Any platform that succeeds for these requests is technically broken with
8035 // Same basic idea, but with non-zero len
8063 // Same basic idea, but with interesting type size
8095 // This is exactly the same as test_try_reserve with the method changed.
8232 v.extend(&[1, 2]); // `slice::Iter` (with `T: Copy`) specialization
8235 v.extend(std::iter::empty::<i32>()); // `TrustedLen` specialization with empty iterator
8895 // FIXME: Instantiated functions with i128 in the signature is not supported in Emscripten.
9080 // Exercise is_dangling() with a DST
9091 // Exercise is_dangling() with a DST
9670 // Sort with many pre-sorted runs.
9740 // of the tuple), so elements with equal first items
9741 // will need to be ordered with increasing
10945 SILENCE_PANIC.with(|s| s.set(true));
10973 if !SILENCE_PANIC.with(|s| s.get()) {
12369 // Any platform that succeeds for these requests is technically broken with
12400 // VecDeque starts with capacity 7, always adds 1 to the capacity
12411 // Same basic idea, but with non-zero len
12439 // Same basic idea, but with interesting type size
12471 // This is exactly the same as test_try_reserve with the method changed.
12501 // VecDeque starts with capacity 7, always adds 1 to the capacity
12932 // we end up with a deque of the correct size
13193 // Basic test to make sure that we can invoke the `write!` macro with an
13213 // can do with them just yet (to test the output)
13224 // can do with them just yet (to test the output)
13877 /// `vec!` allows `Vec`s to be defined with the same syntax as array expressions.
13901 /// using this with types having a nonstandard `Clone` implementation. For
13929 // HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is
13931 // `slice::into_vec` function which is only available with cfg(test)
13957 /// The same convention is used with [`print!`] and [`write!`] macros,
14042 /// to the allocator registered with the `#[global_allocator]` attribute
14055 /// Allocate memory with the global allocator.
14058 /// of the allocator registered with the `#[global_allocator]` attribute
14089 /// Deallocate memory with the global allocator.
14092 /// of the allocator registered with the `#[global_allocator]` attribute
14107 /// Reallocate memory with the global allocator.
14110 /// of the allocator registered with the `#[global_allocator]` attribute
14125 /// Allocate zero-initialized memory with the global allocator.
14128 /// of the allocator registered with the `#[global_allocator]` attribute
14356 /// It can be replaced with [`set_alloc_error_hook`] and [`take_alloc_error_hook`].
14460 /// * Contains a `ptr::Unique` and thus endows the user with all related benefits.
14468 /// `usize::MAX`. This means that you need to be careful when round-tripping this type with a
14487 /// `RawVec` with capacity `0`. If `T` is zero-sized, then it makes a
14488 /// `RawVec` with capacity `usize::MAX`. Useful for implementing
14494 /// Creates a `RawVec` (on the system heap) with exactly the
14498 /// *not* get a `RawVec` with the requested capacity.
14522 /// The `ptr` must be allocated (on the system heap), and with the given `capacity`.
14576 /// Converts the entire buffer into `Box<[MaybeUninit<T>]>` with the specified `len`.
14637 /// The `ptr` must be allocated (via the given allocator `alloc`), and with the given
15071 // loops with hardcoded sizes run much faster
15072 // specialize the cases with small separator lengths
15104 // Currently (2018-05-13) there is a bug with type inference and specialization (see issue #36262)
15135 .expect("attempt to join into collection with len > usize::MAX");
15148 // generate loops with hardcoded offsets for small separators
15214 /// Replaces all matches of a pattern with another string.
15218 /// replaces them with the replacement string slice.
15252 /// Replaces first N matches of a pattern with another string.
15256 /// replaces them with the replacement string slice at most `count` times.
15310 /// A tricky example, with sigma:
15892 // Make sure deriving works with Arc<T>
16176 //! working with [`String`]s.
16189 //! You can create a new [`String`] from an existing one by concatenating with
16235 /// contents of the string. It has a close relationship with its borrowed
16240 /// You can create a `String` from [a literal string][`str`] with [`String::from`]:
16248 /// You can append a [`char`] to a `String` with the [`push`] method, and
16249 /// append a [`&str`] with the [`push_str`] method:
16261 /// If you have a vector of UTF-8 bytes, you can create a `String` from it with
16357 /// You can look at these with the [`as_ptr`], [`len`], and [`capacity`]
16430 /// We end up with a different output:
16540 /// Creates a new empty `String` with a particular capacity.
16543 /// the length of that buffer, and can be queried with the [`capacity`]
16544 /// method. This method creates an empty `String`, but one with an initial
16585 // HACK(japaric): with cfg(test) the inherent `[T]::to_vec` method, which is
16592 panic!("not available with cfg(test)");
16618 /// Returns [`Err`] if the slice is not UTF-8 with a description as to why the
16645 /// with this error.
16666 /// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with
16777 /// invalid data with [the replacement character (`U+FFFD`)][U+FFFD].
16816 /// into a `String` with the [`from_raw_parts`] function, allowing
16845 /// same allocator the standard library uses, with a required alignment of exactly 1.
16899 /// memory unsafety issues with future users of the `String`, as the rest of
17206 /// Shrinks the capacity of this `String` with a lower bound.
17587 /// memory unsafety issues with future users of the `String`, as the rest of
17762 /// and replaces it with the given string.
18816 //! A module for working with borrowed data.
18915 /// work with general borrowed data via the `Borrow` trait.
19223 /// Creates an owned Cow<'a, B> with the default value for the contained owned value.
19318 //! with boxes because each node often has only one owner, the parent.
19327 //! constraining for an application, and is often paired with the [`Cell`] or
19338 //! paired with synchronization primitives such as mutexes to allow mutation of
19350 //! default global allocator. It is not compatible with the libc allocator API.
19455 // Module with internal macros used by other modules (needs to be included before other modules).
19532 //! clashes with `T`'s methods, the methods of [`Rc<T>`][`Rc`] itself are associated
19581 //! We want to have our `Gadget`s point to their `Owner`. We can't do this with
19633 //! // with them the last counted references to our `Owner`. Gadget Man now
19646 //! place. In order to end up with two values that point at each other, one of
19736 //! [fully qualified syntax]: https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-calling-methods-with-the-same-name
19772 // would interfere with otherwise safe [into|from]_raw() of transmutable
19788 /// `value.get_mut()`. This avoids conflicts with methods of the inner type `T`.
19873 // Construct the inner in the "uninitialized" state with a single
19911 /// Constructs a new `Rc` with uninitialized contents.
19943 /// Constructs a new `Rc` with uninitialized contents, with the memory
19944 /// being filled with `0` bytes.
19997 /// Constructs a new `Rc` with uninitialized contents, returning an error if the allocation fails
20031 /// Constructs a new `Rc` with uninitialized contents, with the memory
20032 /// being filled with `0` bytes, returning an error if the allocation fails
20072 /// Otherwise, an [`Err`] is returned with the same `Rc` that was
20112 /// Constructs a new reference-counted slice with uninitialized contents.
20140 /// Constructs a new reference-counted slice with uninitialized contents, with the memory being
20141 /// filled with `0` bytes.
20180 /// As with [`MaybeUninit::assume_init`],
20219 /// As with [`MaybeUninit::assume_init`],
20408 /// Increments the strong reference count on the `Rc<T>` associated with the
20441 /// Decrements the strong reference count on the `Rc<T>` associated with the
20543 // this would conflict with accesses to the reference counts (e.g. by `Weak`).
20688 /// Allocates an `RcBox<T>` with sufficient space for
20691 /// The function `mem_to_rcbox` is called with the data pointer
20709 /// Allocates an `RcBox<T>` with sufficient space for
20713 /// The function `mem_to_rcbox` is called with the data pointer
20742 /// Allocates an `RcBox<T>` with sufficient space for an unsized inner value
20778 /// Allocates an `RcBox<[T]>` with the given length.
20952 /// Creates a new `Rc<T>`, with the `Default` value for `T`.
21542 /// back into the `Weak<T>` with [`from_raw`].
21544 /// The same restrictions of accessing the target of the pointer as with
21577 /// It takes ownership of one weak reference (with the exception of pointers created by [`new`],
21587 /// count is not modified by this operation) and therefore it must be paired with a previous
21711 /// (because they were created with `Weak::new()`).
21847 // NOTE: We checked_add here to deal with mem::forget safely. In particular
22184 // allocated above with the capacity of `s`, and initialize to `s.len()` in
22233 /// Sorts the slice with a comparator function.
22287 /// Sorts the slice with a key extraction function.
22328 /// Sorts the slice with a key extraction function.
22342 /// which combines the fast average case of randomized quicksort with the fast worst case of
22343 /// heapsort, while achieving linear time on slices with certain patterns. It uses some
22344 /// randomization to avoid degenerate cases, but with a fixed seed to always provide
22373 // stable with respect to the original slice. We use `sort_unstable` here because
22427 /// Copies `self` into a new `Vec` with an allocator.
22660 /// This is because there could exist `V` types with multiple `Borrow<[_]>` impls,
22829 // performance than with the 2nd method.
22842 // fill the hole in `v` with `tmp`, thus ensuring that `v` still holds every object it
22903 // hole in `v` with the unconsumed range in `buf`, thus ensuring that `v` still holds every
23125 //! Types and Traits for working with asynchronous tasks.
23368 /// In the end, this means that you may need to pair `Arc<T>` with some sort of
23371 /// ## Breaking cycles with `Weak`
23403 /// clashes with `T`'s methods, the methods of `Arc<T>` itself are associated
23443 /// [fully qualified syntax]: https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-calling-methods-with-the-same-name
23570 // would interfere with otherwise safe [into|from]_raw() of transmutable
23633 // Construct the inner in the "uninitialized" state with a single
23661 // in order to synchronize with the `compare_exchange_weak` in `Weak::upgrade`.
23664 // of `data_fn` we only need to look at what it could do with a reference to a
23670 // possible with safe code alone.
23683 /// Constructs a new `Arc` with uninitialized contents.
23715 /// Constructs a new `Arc` with uninitialized contents, with the memory
23716 /// being filled with `0` bytes.
23777 /// Constructs a new `Arc` with uninitialized contents, returning an error
23812 /// Constructs a new `Arc` with uninitialized contents, with the memory
23813 /// being filled with `0` bytes, returning an error if allocation fails.
23846 /// Otherwise, an [`Err`] is returned with the same `Arc` that was
23885 /// Constructs a new atomically reference-counted slice with uninitialized contents.
23913 /// Constructs a new atomically reference-counted slice with uninitialized contents, with the memory being
23914 /// filled with `0` bytes.
23953 /// As with [`MaybeUninit::assume_init`],
23992 /// As with [`MaybeUninit::assume_init`],
24152 // to deal with overflow.
24154 // Unlike with Clone(), we need this to be an Acquire read to
24155 // synchronize with the write coming from `is_unique`, so that the
24223 /// Increments the strong reference count on the `Arc<T>` associated with the
24258 /// Decrements the strong reference count on the `Arc<T>` associated with the
24340 /// Allocates an `ArcInner<T>` with sufficient space for
24343 /// The function `mem_to_arcinner` is called with the data pointer
24361 /// Allocates an `ArcInner<T>` with sufficient space for
24365 /// The function `mem_to_arcinner` is called with the data pointer
24392 /// Allocates an `ArcInner<T>` with sufficient space for an unsized inner value.
24428 /// Allocates an `ArcInner<[T]>` with the given length.
24543 // reference counter can always be done with memory_order_relaxed: New
24636 // optimization: we are always racing with weak pointers being
24645 // locked by a thread with a strong reference.
24664 // As with `get_mut()`, the unsafety is ok because our reference was
24665 // either unique to begin with, or became one upon cloning the contents.
24741 // this would alias with concurrent access to the reference counts (e.g. by `Weak`).
24753 // The acquire label here ensures a happens-before relationship with any
24758 // This needs to be an `Acquire` to synchronize with the decrement of the `strong`
24763 // The release write here synchronizes with a read in `downgrade`,
24804 // with other threads unless we are going to delete the object. This
24812 // of the reference count synchronizes with this `Acquire` fence. This
24832 // Also note that the Acquire fence here could probably be replaced with an
24954 /// back into the `Weak<T>` with [`from_raw`].
24956 /// The same restrictions of accessing the target of the pointer as with
24989 /// It takes ownership of one weak reference (with the exception of pointers created by [`new`],
24999 /// count is not modified by this operation) and therefore it must be paired with a previous
25095 // Acquire is necessary for the success case to synchronise with `Arc::new_cyclic`, when the inner
25163 /// (because they were created with `Weak::new()`).
25527 /// Creates a new `Arc<T>`, with the `Default` value for `T`.
25821 //! format!("{:04}", 42); // => "0042" with leading zeros
25884 //! arguments that have names. Like with positional parameters, it is not
25912 //! Referring to an argument with the dollar syntax does not affect the "next
25925 //! The optional fill character and alignment is provided normally in conjunction with the
25937 //! default for numeric formatters is also a space character but with right-alignment. If
25970 //! * `#x` - precedes the argument with a `0x`
25971 //! * `#X` - precedes the argument with a `0x`
25972 //! * `#b` - precedes the argument with a `0b`
25973 //! * `#o` - precedes the argument with a `0o`
25975 //! both be done with a `0` character as well as be sign-aware. A format
25980 //! and before the digits. When used together with the `#` flag, a similar
25988 //! value is emitted with proper `fill`, `alignment` and `width` if those parameters are set.
26007 //! `.*` means that this `{...}` is associated with *two* format inputs rather than one: the
26015 //! // Hello {arg 0 ("x")} is {arg 1 (0.01) with precision specified inline (5)}
26018 //! // Hello {arg 1 ("x")} is {arg 2 (0.01) with precision specified in arg 0 (5)}
26021 //! // Hello {arg 0 ("x")} is {arg 2 (0.01) with precision specified in arg 1 (5)}
26024 //! // Hello {next arg ("x")} is {second of next two args (0.01) with precision
26028 //! // Hello {next arg ("x")} is {arg 2 (0.01) with precision
26032 //! // Hello {next arg ("x")} is {arg "number" (0.01) with precision specified
26071 //! them with the same character. For example, the `{` character is escaped with
26072 //! `{{` and the `}` character is escaped with `}}`.
26083 //! so it should not be too alien. Arguments are formatted with Python-like
26107 //! When requesting that an argument be formatted with a particular type, you
26114 //! * `x?` ⇒ [`Debug`] with lower-case hexadecimal integers
26115 //! * `X?` ⇒ [`Debug`] with upper-case hexadecimal integers
26125 //! [`fmt::Binary`][`Binary`] trait can then be formatted with `{:b}`. Implementations
26147 //! [`Formatter`] struct. In order to help with this, the [`Formatter`] struct also
26290 //! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro"));
26302 //! when dealing with formatting strings.
26354 /// The [`Arguments`] instance can be created with the [`format_args!`] macro.
26945 //! A doubly-linked list with owned nodes.
26973 /// A doubly-linked list with owned nodes.
27435 /// Provides a forward iterator with mutable references.
27473 /// Provides a cursor with editing operations at the front element.
27491 /// Provides a cursor with editing operations at the back element.
28079 /// A cursor over a `LinkedList` with editing operations.
28434 /// new list consisting of everything after the cursor, with the original
28450 /// new list consisting of everything before the cursor, with the original
28490 // `unlink_node` is okay with aliasing `element` references.
29237 // Found a node with space left, push here.
29439 // Minimal type with an `Ord` implementation violating transitivity.
29488 // Type with an `Ord` implementation that forms a total order at any moment
29561 /// Returns a `Found` with the handle of the matching KV, if any. Otherwise,
29562 /// returns a `GoDown` with the handle of the leaf edge where the key belongs.
29589 /// If found, returns an `Ok` with that node, the strictly ascending pair of
29594 /// If not found, returns an `Err` with the leaf edge matching the entire
29695 /// Returns a `Found` with the handle of the matching KV, if any. Otherwise,
29696 /// returns a `GoDown` with the handle of the edge where the key might be found
29766 /// with an additional parameter to skip part of the key array.
29816 // A tree in a `BTreeMap` is a tree in the `node` module with additional invariants:
29872 /// movie_reviews.insert("Office Space", "Deals with real issues in the workplace.");
29886 /// // look up the values associated with some keys.
30578 // See `get` for implementation notes, this is basically a copy-paste with mut's added
30738 /// // Keep only the elements with even-numbered keys.
32120 /// Split off a tree with key-value pairs at and after the given key.
32679 /// Returns `true` if `self` has no elements in common with `other`.
33894 /// with care.
33897 // twice, and never end up with overlapping value references.
33906 /// used with the utmost care.
33918 /// Given a leaf edge handle, returns [`Result::Ok`] with a handle to the neighboring KV
33920 /// If the leaf edge is the last one in the tree, returns [`Result::Err`] with the root node.
33939 /// Given a leaf edge handle, returns [`Result::Ok`] with a handle to the neighboring KV
33941 /// If the leaf edge is the first one in the tree, returns [`Result::Err`] with the root node.
33964 /// Given an internal edge handle, returns [`Result::Ok`] with a handle to the neighboring KV
33966 /// If the internal edge is the last one in the tree, returns [`Result::Err`] with the root node.
34127 /// The only safe way to proceed with the updated handle is to compare it, drop it,
34145 /// The only safe way to proceed with the updated handle is to compare it, drop it,
34569 // Only tests the simple function definition with respect to intersection
34981 // Unlike the function with the same name in map/tests, returns no values.
35017 // special case with maximum height.
35146 "failed to insert {:?}, key {:?} already exists with value {:?}",
35204 /// unnecessary, unlike with `.or_insert_with(|| ... )`.
35341 /// Sets the value of the entry with the `VacantEntry`'s key,
35500 /// Sets the value of the entry with the `OccupiedEntry`'s key,
35577 // Capacity of a tree with a single level,
35581 // Minimum number of elements to insert, to guarantee a tree with 2 levels,
35582 // i.e., a tree who's root is an internal node at height 1, with edges to leaf nodes.
35586 // Minimum number of elements to insert in ascending order, to guarantee a tree with 3 levels,
35587 // i.e., a tree who's root is an internal node at height 2, with edges to more internal nodes.
35616 // Check consistency of `length` with what navigation code encounters.
35713 // - 1 element in internal root node with 2 children
35725 // - 1 element in internal root node with 2 children
35726 // - 6 elements in left internal child with 7 grandchildren
35727 // - 42 elements in left child's 7 grandchildren with 6 elements each
35728 // - 5 elements in right internal child with 6 grandchildren
35729 // - 30 elements in right child's 5 first grandchildren with 6 elements each
35988 // Check many alignments and trees with roots at various heights.
36198 // Tests tree with a root and 2 leaves. The single key in the root node is
36936 // This test's only purpose is to ensure that zero-sized keys with nonsensical orderings
36937 // do not cause segfaults when used with zero-sized values. All other map behavior is
37044 // Test a tree with 2 semi-full levels and a tree with 3 levels.
37571 // In a tree with 3 levels, if all but a part of the first leaf node is split off,
37586 // In a tree with 3 levels, if only part of the last leaf node is split off,
37626 // special case with maximum height.
37940 // we make do with lots of unsafety.
37943 // weirdly shaped) container and avoiding dealing with most of the B-Tree invariants. As such,
38011 /// The underlying representation of internal nodes. As with `LeafNode`s, these should be hidden
38064 /// with respect to keys and tree structure, but also allows many
38202 /// height means the node is a leaf itself. If you picture trees with the
38204 /// If you picture trees with leaves on top, the number says how high
38232 /// The method name assumes you picture trees with the root node on top.
38412 // to avoid aliasing with outstanding references to other elements,
38469 /// Returns a new owned tree, with its own root node that is initially empty.
38474 /// Adds a new internal node with a single edge pointing to the previous root node,
38624 /// pairs. For example, in a node with length 2, there would be 3 possible edge locations - one
38904 /// The method name assumes you picture trees with the root node on top.
38914 // node pointer is dereferenced, we access the edges array with a
39015 /// Removes the key-value pair pointed to by this handle and returns it, along with the edge
39086 /// merging with the left sibling is faster, since we only need to move
39132 /// in a node to combine the central KV with both adjacent child nodes.
39506 // Altered node in existing tree with elements and edges that belong to the left of `kv`.
39510 // Owned, unattached, new node with elements and edges that belong to the right of `kv`.
39735 /// Stocks up a possibly underfull node by merging with or stealing from a
40002 /// Extends `self` with the contents of the given iterator.
40300 /// For example, given deques "A" and "B" with the following division into slices:
40358 //! A double-ended queue implemented with a growable ring buffer.
40420 /// A double-ended queue implemented with a growable ring buffer.
40822 /// Creates an empty `VecDeque` with space for at least `capacity` elements.
41116 /// Shrinks the capacity of the `VecDeque` with a lower bound.
41829 /// replacing it with the first element.
41863 /// Removes an element from anywhere in the `VecDeque` and returns it, replacing it with the
41898 /// Inserts an element at `index` within the `VecDeque`, shifting all elements with indices
42615 // - then restart the algorithm with a new (smaller) store
42617 // of the buffer - this means we've hit the right order with fewer swaps!
42734 // so it's sound to call here because we're calling with something
42771 /// Looks up a series of four elements. The first is found, with a
42810 /// Binary searches this sorted `VecDeque` with a comparator function.
42813 /// with the sort order of the underlying `VecDeque`, returning an
42831 /// Looks up a series of four elements. The first is found, with a
42864 /// Binary searches this sorted `VecDeque` with a key extraction function.
42866 /// Assumes that the `VecDeque` is sorted by the key, for instance with
42885 /// their second elements. The first is found, with a uniquely
43962 // In these cases there is enough free space to solve it with copies
43980 // Now there's not (necessarily) space to straighten the ring with simple copies,
44268 //! A priority queue implemented with a binary heap.
44280 //! It shows how to use [`BinaryHeap`] with custom types.
44334 //! // We're at `start`, with a zero cost
44338 //! // Examine the frontier with lower cost nodes first (min-heap)
44346 //! // For each node we can reach, see if we can find a way with
44424 /// A priority queue implemented with a binary heap.
44626 /// Creates an empty `BinaryHeap` with a specific capacity.
44837 // compare with the greater of the two children
45225 /// Discards capacity with a lower bound.
45384 /// position with the value that was originally removed.
45982 // vectors with 0-size elements this would return the
46655 // HACK(japaric): with cfg(test) the inherent `[T]::to_vec` method, which is
46657 // `slice::to_vec` function which is only available with cfg(test)
46809 //! A contiguous growable array type with heap-allocated contents, written
46819 //! You can explicitly create a [`Vec`] with [`Vec::new`]:
46971 /// It can also initialize each element of a `Vec<T>` with a given value.
47051 /// elements that will be added onto the vector. This is not to be confused with
47057 /// For example, a vector with capacity 10 and length 0 would be an empty vector
47058 /// with space for 10 more elements. Pushing 10 or fewer elements onto the
47079 /// if you construct a `Vec` with capacity 0 via [`Vec::new`], [`vec![]`][`vec!`],
47096 /// A vector containing the elements `'a'` and `'b'` with capacity 4 can be
47148 /// with exactly the requested capacity. If [`len`]` == `[`capacity`],
47209 /// Constructs a new, empty `Vec<T>` with the specified capacity.
47262 /// * `T` needs to have the same size and alignment as what `ptr` was allocated with.
47265 /// allocated and deallocated with the same layout.)
47267 /// * `capacity` needs to be the capacity that the pointer was allocated with.
47271 /// to build a `Vec<u8>` from a pointer to a C `char` array with length `size_t`.
47274 /// alignments. The buffer was allocated with alignment 2 (for `u16`), but after
47275 /// turning it into a `Vec<u8>` it'll be deallocated with alignment 1.
47305 /// // Overwrite memory with 4, 5, 6
47343 /// Constructs a new, empty `Vec<T, A>` with the specified capacity with the provided
47400 /// * `T` needs to have the same size and alignment as what `ptr` was allocated with.
47403 /// allocated and deallocated with the same layout.)
47405 /// * `capacity` needs to be the capacity that the pointer was allocated with.
47409 /// to build a `Vec<u8>` from a pointer to a C `char` array with length `size_t`.
47412 /// alignments. The buffer was allocated with alignment 2 (for `u16`), but after
47413 /// turning it into a `Vec<u8>` it'll be deallocated with alignment 1.
47451 /// // Overwrite memory with 4, 5, 6
47477 /// into a `Vec` with the [`from_raw_parts`] function, allowing
47514 /// into a `Vec` with the [`from_raw_parts_in`] function, allowing
47716 // by only calling it with a greater capacity.
47722 /// Shrinks the capacity of the vector with a lower bound.
48084 // We replace self[index] with the last element. Note that if the
48274 // SAFETY: `deleted_cnt` > 0, so the hole slot must not overlap with current element.
48417 /* Technically we could let `gap` clean up with its Drop, but
48515 /// iterator **is not** dropped (with [`mem::forget`] for example), it is
48624 /// the elements `[0, at)` with its previous capacity unchanged.
48679 /// difference, with each additional slot filled with the result of
48749 /// The returned slice can be used to fill the vector with data (e.g. by
48790 /// Returns vector content as a slice of `T`, along with the remaining spare
48793 /// The returned spare capacity slice can be used to fill the vector with data
48799 /// Note that this is a low-level API, which should be used with care for
48862 // - `spare_ptr` is pointing one element past the buffer, so it doesn't overlap with `initialized`
48876 /// difference, with each additional slot filled with `value`.
48912 /// specialized to work with slices instead. If and when Rust gets
49088 // - Element was just initialized with `MaybeUninit::write`, so it's ok to increase len
49108 // anything with the original values
49150 // HACK(japaric): with cfg(test) the inherent `[T]::to_vec` method, which is
49152 // `slice::to_vec` function which is only available with cfg(test)
49322 /// with the given `replace_with` iterator and yields the removed items.
49630 /// newly-allocated buffer with exactly the right capacity.
49644 /// Allocate a `Vec<u8>` and fill it with a UTF-8 string.
49678 /// If you're fine with just getting a prefix of the `Vec<T>`,
49709 // that the optimizer will see does not alias with any stores through the Vec's data
50052 /// Fill that range as much as possible with new elements from the `replace_with` iterator.
50227 //! raw pointer allocated with the [`Global`] allocator, given that the
50228 //! [`Layout`] used with the allocator is correct for the type. More precisely,
50229 //! a `value: *mut T` that has been allocated with the [`Global`] allocator
50230 //! with `Layout::for_value(&*value)` may be converted into a box using
50233 //! [`Global`] allocator with [`Layout::for_value(&*value)`].
50243 //! as a single pointer and is also ABI-compatible with C pointers
50257 //! /* Takes ownership from the caller; no-op when invoked with NULL */
50284 //! free the value with the global allocator. In general, the best practice
50358 /// Constructs a new box with uninitialized contents.
50382 /// Constructs a new `Box` with uninitialized contents, with the memory
50383 /// being filled with `0` bytes.
50434 /// Constructs a new box with uninitialized contents on the heap,
50461 /// Constructs a new `Box` with uninitialized contents, with the memory
50462 /// being filled with `0` bytes on the heap
50537 /// Constructs a new box with uninitialized contents in the provided allocator.
50569 /// Constructs a new box with uninitialized contents in the provided allocator,
50599 /// Constructs a new `Box` with uninitialized contents, with the memory
50600 /// being filled with `0` bytes in the provided allocator.
50631 /// Constructs a new `Box` with uninitialized contents, with the memory
50632 /// being filled with `0` bytes in the provided allocator,
50700 /// Constructs a new boxed slice with uninitialized contents.
50725 /// Constructs a new boxed slice with uninitialized contents, with the memory
50726 /// being filled with `0` bytes.
50750 /// Constructs a new boxed slice with uninitialized contents in the provided allocator.
50778 /// Constructs a new boxed slice with uninitialized contents in the provided allocator,
50779 /// with the memory being filled with `0` bytes.
50810 /// As with [`MaybeUninit::assume_init`],
50847 /// As with [`MaybeUninit::assume_init`],
50888 /// with the [memory layout] used by `Box` .
50937 /// with the [memory layout] used by `Box` .
50992 /// do this is to convert the raw pointer back into a `Box` with the
50998 /// is so that there is no conflict with a method on the inner type.
51001 /// Converting the raw pointer back into a `Box` with [`Box::from_raw`]
51037 /// do this is to convert the raw pointer back into a `Box` with the
51043 /// is so that there is no conflict with a method on the inner type.
51046 /// Converting the raw pointer back into a `Box` with [`Box::from_raw_in`]
51103 /// is so that there is no conflict with a method on the inner type.
51118 /// with the [`Box::from_raw`] function producing a `Box`. This `Box` can
51124 /// is so that there is no conflict with a method on the inner type.
51180 /// Creates a `Box<T>`, with the `Default` value for T.
51202 /// Returns a new box with a `clone()` of this box's contents.
51809 * Another type with the same semantics as Box but only a conditional