diff options
| author | Roman Proskuryakov <humbug@deeptown.org> | 2020-07-05 15:02:01 +0300 |
|---|---|---|
| committer | Roman Proskuryakov <humbug@deeptown.org> | 2020-07-05 15:47:08 +0300 |
| commit | eff62069ad602090e8d27b83cffd9e77479ed4be (patch) | |
| tree | 6fb5ca35f019a29a7c41ce206d53c17968376c75 /src/liballoc | |
| parent | 7d4a92d4f8dc03409984695d78893fffdd3ff1f9 (diff) | |
| download | rust-eff62069ad602090e8d27b83cffd9e77479ed4be.tar.gz rust-eff62069ad602090e8d27b83cffd9e77479ed4be.zip | |
Remove the usage of the LengthAtMost32 trait
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 11 | ||||
| -rw-r--r-- | src/liballoc/collections/vec_deque.rs | 7 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/vec.rs | 24 |
5 files changed, 17 insertions, 37 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 3320ebdf821..f225aa18853 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -130,7 +130,6 @@ #![stable(feature = "rust1", since = "1.0.0")] use core::any::Any; -use core::array::LengthAtMost32; use core::borrow; use core::cmp::Ordering; use core::convert::{From, TryFrom}; @@ -871,10 +870,7 @@ impl From<Box<str>> for Box<[u8]> { } #[stable(feature = "box_from_array", since = "1.45.0")] -impl<T, const N: usize> From<[T; N]> for Box<[T]> -where - [T; N]: LengthAtMost32, -{ +impl<T, const N: usize> From<[T; N]> for Box<[T]> { /// Converts a `[T; N]` into a `Box<[T]>` /// /// This conversion moves the array to newly heap-allocated memory. @@ -890,10 +886,7 @@ where } #[stable(feature = "boxed_slice_try_from", since = "1.43.0")] -impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]> -where - [T; N]: LengthAtMost32, -{ +impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]> { type Error = Box<[T]>; fn try_from(boxed_slice: Box<[T]>) -> Result<Self, Self::Error> { diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index 15f3a94ca2d..ba455b1e5b7 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -9,7 +9,6 @@ // ignore-tidy-filelength -use core::array::LengthAtMost32; use core::cmp::{self, Ordering}; use core::fmt; use core::hash::{Hash, Hasher}; @@ -2799,9 +2798,9 @@ macro_rules! __impl_slice_eq1 { __impl_slice_eq1! { [] VecDeque<A>, Vec<B>, } __impl_slice_eq1! { [] VecDeque<A>, &[B], } __impl_slice_eq1! { [] VecDeque<A>, &mut [B], } -__impl_slice_eq1! { [const N: usize] VecDeque<A>, [B; N], [B; N]: LengthAtMost32 } -__impl_slice_eq1! { [const N: usize] VecDeque<A>, &[B; N], [B; N]: LengthAtMost32 } -__impl_slice_eq1! { [const N: usize] VecDeque<A>, &mut [B; N], [B; N]: LengthAtMost32 } +__impl_slice_eq1! { [const N: usize] VecDeque<A>, [B; N], } +__impl_slice_eq1! { [const N: usize] VecDeque<A>, &[B; N], } +__impl_slice_eq1! { [const N: usize] VecDeque<A>, &mut [B; N], } #[stable(feature = "rust1", since = "1.0.0")] impl<A: PartialOrd> PartialOrd for VecDeque<A> { diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 4d50ae9efca..fd25e6935af 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -235,7 +235,6 @@ use crate::boxed::Box; use std::boxed::Box; use core::any::Any; -use core::array::LengthAtMost32; use core::borrow; use core::cell::Cell; use core::cmp::Ordering; @@ -1522,10 +1521,7 @@ where } #[stable(feature = "boxed_slice_try_from", since = "1.43.0")] -impl<T, const N: usize> TryFrom<Rc<[T]>> for Rc<[T; N]> -where - [T; N]: LengthAtMost32, -{ +impl<T, const N: usize> TryFrom<Rc<[T]>> for Rc<[T; N]> { type Error = Rc<[T]>; fn try_from(boxed_slice: Rc<[T]>) -> Result<Self, Self::Error> { diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 826f0c8fa83..9a0daa20160 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -7,7 +7,6 @@ //! [arc]: struct.Arc.html use core::any::Any; -use core::array::LengthAtMost32; use core::borrow; use core::cmp::Ordering; use core::convert::{From, TryFrom}; @@ -2159,10 +2158,7 @@ where } #[stable(feature = "boxed_slice_try_from", since = "1.43.0")] -impl<T, const N: usize> TryFrom<Arc<[T]>> for Arc<[T; N]> -where - [T; N]: LengthAtMost32, -{ +impl<T, const N: usize> TryFrom<Arc<[T]>> for Arc<[T; N]> { type Error = Arc<[T]>; fn try_from(boxed_slice: Arc<[T]>) -> Result<Self, Self::Error> { diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 5db96a504a6..3f05719ba9a 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -59,7 +59,6 @@ #![stable(feature = "rust1", since = "1.0.0")] -use core::array::LengthAtMost32; use core::cmp::{self, Ordering}; use core::fmt; use core::hash::{Hash, Hasher}; @@ -2379,18 +2378,18 @@ __impl_slice_eq1! { [] &mut [A], Vec<B>, #[stable(feature = "partialeq_vec_for_r __impl_slice_eq1! { [] Cow<'_, [A]>, Vec<B> where A: Clone, #[stable(feature = "rust1", since = "1.0.0")] } __impl_slice_eq1! { [] Cow<'_, [A]>, &[B] where A: Clone, #[stable(feature = "rust1", since = "1.0.0")] } __impl_slice_eq1! { [] Cow<'_, [A]>, &mut [B] where A: Clone, #[stable(feature = "rust1", since = "1.0.0")] } -__impl_slice_eq1! { [const N: usize] Vec<A>, [B; N] where [B; N]: LengthAtMost32, #[stable(feature = "rust1", since = "1.0.0")] } -__impl_slice_eq1! { [const N: usize] Vec<A>, &[B; N] where [B; N]: LengthAtMost32, #[stable(feature = "rust1", since = "1.0.0")] } +__impl_slice_eq1! { [const N: usize] Vec<A>, [B; N], #[stable(feature = "rust1", since = "1.0.0")] } +__impl_slice_eq1! { [const N: usize] Vec<A>, &[B; N], #[stable(feature = "rust1", since = "1.0.0")] } // NOTE: some less important impls are omitted to reduce code bloat // FIXME(Centril): Reconsider this? -//__impl_slice_eq1! { [const N: usize] Vec<A>, &mut [B; N], [B; N]: LengthAtMost32 } -//__impl_slice_eq1! { [const N: usize] [A; N], Vec<B>, [A; N]: LengthAtMost32 } -//__impl_slice_eq1! { [const N: usize] &[A; N], Vec<B>, [A; N]: LengthAtMost32 } -//__impl_slice_eq1! { [const N: usize] &mut [A; N], Vec<B>, [A; N]: LengthAtMost32 } -//__impl_slice_eq1! { [const N: usize] Cow<'a, [A]>, [B; N], [B; N]: LengthAtMost32 } -//__impl_slice_eq1! { [const N: usize] Cow<'a, [A]>, &[B; N], [B; N]: LengthAtMost32 } -//__impl_slice_eq1! { [const N: usize] Cow<'a, [A]>, &mut [B; N], [B; N]: LengthAtMost32 } +//__impl_slice_eq1! { [const N: usize] Vec<A>, &mut [B; N], } +//__impl_slice_eq1! { [const N: usize] [A; N], Vec<B>, } +//__impl_slice_eq1! { [const N: usize] &[A; N], Vec<B>, } +//__impl_slice_eq1! { [const N: usize] &mut [A; N], Vec<B>, } +//__impl_slice_eq1! { [const N: usize] Cow<'a, [A]>, [B; N], } +//__impl_slice_eq1! { [const N: usize] Cow<'a, [A]>, &[B; N], } +//__impl_slice_eq1! { [const N: usize] Cow<'a, [A]>, &mut [B; N], } /// Implements comparison of vectors, lexicographically. #[stable(feature = "rust1", since = "1.0.0")] @@ -2494,10 +2493,7 @@ impl<T: Clone> From<&mut [T]> for Vec<T> { } #[stable(feature = "vec_from_array", since = "1.44.0")] -impl<T, const N: usize> From<[T; N]> for Vec<T> -where - [T; N]: LengthAtMost32, -{ +impl<T, const N: usize> From<[T; N]> for Vec<T> { #[cfg(not(test))] fn from(s: [T; N]) -> Vec<T> { <[T]>::into_vec(box s) |
