diff options
| author | bors <bors@rust-lang.org> | 2024-07-28 18:49:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-28 18:49:55 +0000 |
| commit | 2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b (patch) | |
| tree | 2b2d6044bc2153a15d65e9ae7abd307f52c9adef /library/alloc/src/vec/mod.rs | |
| parent | 188ddf4d6a694fa263c2ff8be8f8eade659599d6 (diff) | |
| parent | eeb76ccaf0f20819c1e4360420e7b1aff94c5c9d (diff) | |
Auto merge of #128313 - GuillaumeGomez:rollup-kacb489, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - #125779 ([rustdoc] Add copy code feature) - #127765 (Fix doc nits) - #127860 (deps: dedup object, wasmparser, wasm-encoder) - #128103 (add `is_multiple_of` for unsigned integer types) - #128228 (Stabilize `const_waker`) - #128240 (Add links from `assert_eq!` docs to `debug_assert_eq!`, etc.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src/vec/mod.rs')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index f63a6dd6749..db81fc05c34 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2373,9 +2373,11 @@ impl<T, A: Allocator> Vec<T, A> { } /// Consumes and leaks the `Vec`, returning a mutable reference to the contents, - /// `&'a mut [T]`. Note that the type `T` must outlive the chosen lifetime - /// `'a`. If the type has only static references, or none at all, then this - /// may be chosen to be `'static`. + /// `&'a mut [T]`. + /// + /// Note that the type `T` must outlive the chosen lifetime `'a`. If the type + /// has only static references, or none at all, then this may be chosen to be + /// `'static`. /// /// As of Rust 1.57, this method does not reallocate or shrink the `Vec`, /// so the leaked allocation may include unused capacity that is not part @@ -3359,7 +3361,7 @@ impl<T, A: Allocator> AsMut<[T]> for Vec<T, A> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] impl<T: Clone> From<&[T]> for Vec<T> { - /// Allocate a `Vec<T>` and fill it by cloning `s`'s items. + /// Allocates a `Vec<T>` and fills it by cloning `s`'s items. /// /// # Examples /// @@ -3379,7 +3381,7 @@ impl<T: Clone> From<&[T]> for Vec<T> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "vec_from_mut", since = "1.19.0")] impl<T: Clone> From<&mut [T]> for Vec<T> { - /// Allocate a `Vec<T>` and fill it by cloning `s`'s items. + /// Allocates a `Vec<T>` and fills it by cloning `s`'s items. /// /// # Examples /// @@ -3399,7 +3401,7 @@ impl<T: Clone> From<&mut [T]> for Vec<T> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "vec_from_array_ref", since = "1.74.0")] impl<T: Clone, const N: usize> From<&[T; N]> for Vec<T> { - /// Allocate a `Vec<T>` and fill it by cloning `s`'s items. + /// Allocates a `Vec<T>` and fills it by cloning `s`'s items. /// /// # Examples /// @@ -3414,7 +3416,7 @@ impl<T: Clone, const N: usize> From<&[T; N]> for Vec<T> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "vec_from_array_ref", since = "1.74.0")] impl<T: Clone, const N: usize> From<&mut [T; N]> for Vec<T> { - /// Allocate a `Vec<T>` and fill it by cloning `s`'s items. + /// Allocates a `Vec<T>` and fills it by cloning `s`'s items. /// /// # Examples /// @@ -3429,7 +3431,7 @@ impl<T: Clone, const N: usize> From<&mut [T; N]> for Vec<T> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "vec_from_array", since = "1.44.0")] impl<T, const N: usize> From<[T; N]> for Vec<T> { - /// Allocate a `Vec<T>` and move `s`'s items into it. + /// Allocates a `Vec<T>` and moves `s`'s items into it. /// /// # Examples /// @@ -3452,7 +3454,7 @@ impl<'a, T> From<Cow<'a, [T]>> for Vec<T> where [T]: ToOwned<Owned = Vec<T>>, { - /// Convert a clone-on-write slice into a vector. + /// Converts a clone-on-write slice into a vector. /// /// If `s` already owns a `Vec<T>`, it will be returned directly. /// If `s` is borrowing a slice, a new `Vec<T>` will be allocated and @@ -3475,7 +3477,7 @@ where #[cfg(not(test))] #[stable(feature = "vec_from_box", since = "1.18.0")] impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> { - /// Convert a boxed slice into a vector by transferring ownership of + /// Converts a boxed slice into a vector by transferring ownership of /// the existing heap allocation. /// /// # Examples @@ -3494,7 +3496,7 @@ impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> { #[cfg(not(test))] #[stable(feature = "box_from_vec", since = "1.20.0")] impl<T, A: Allocator> From<Vec<T, A>> for Box<[T], A> { - /// Convert a vector into a boxed slice. + /// Converts a vector into a boxed slice. /// /// Before doing the conversion, this method discards excess capacity like [`Vec::shrink_to_fit`]. /// @@ -3522,7 +3524,7 @@ impl<T, A: Allocator> From<Vec<T, A>> for Box<[T], A> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] impl From<&str> for Vec<u8> { - /// Allocate a `Vec<u8>` and fill it with a UTF-8 string. + /// Allocates a `Vec<u8>` and fills it with a UTF-8 string. /// /// # Examples /// |
