about summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-08 21:41:48 +0000
committerbors <bors@rust-lang.org>2022-01-08 21:41:48 +0000
commit23ce5fc4655ed546f74a85fc8836e95bec0c64fd (patch)
treede1cb5360f9fe14a7f7cedb87998da56e9268981 /library/alloc/src/vec
parenta7e2e33960e95d2eb1a2a2aeec169dba5f73de05 (diff)
parent3ae0dabddbec41422549d2f0f4512c3d3415d0af (diff)
downloadrust-23ce5fc4655ed546f74a85fc8836e95bec0c64fd.tar.gz
rust-23ce5fc4655ed546f74a85fc8836e95bec0c64fd.zip
Auto merge of #92068 - fee1-dead:libcore2021, r=m-ou-se
Switch all libraries to the 2021 edition

The fix for https://github.com/rust-lang/rust/issues/88638#issuecomment-996620107 is to simply add const-stability for these functions.

r? `@m-ou-se`

Closes #88638.
Diffstat (limited to 'library/alloc/src/vec')
-rw-r--r--library/alloc/src/vec/mod.rs3
1 files changed, 0 insertions, 3 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 3ad48a1d283..78f989e730d 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -3004,14 +3004,12 @@ impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
     /// # Examples
     ///
     /// ```
-    /// use std::convert::TryInto;
     /// assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));
     /// assert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
     /// ```
     ///
     /// If the length doesn't match, the input comes back in `Err`:
     /// ```
-    /// use std::convert::TryInto;
     /// let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();
     /// assert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
     /// ```
@@ -3019,7 +3017,6 @@ impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
     /// If you're fine with just getting a prefix of the `Vec<T>`,
     /// you can call [`.truncate(N)`](Vec::truncate) first.
     /// ```
-    /// use std::convert::TryInto;
     /// let mut v = String::from("hello world").into_bytes();
     /// v.sort();
     /// v.truncate(2);