diff options
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/lib.rs | 1 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/vec.rs | 24 |
6 files changed, 17 insertions, 38 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 fa65d6ce8d7..d3c6d493d6d 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}; @@ -2889,9 +2888,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/lib.rs b/src/liballoc/lib.rs index 87aee950082..90e2d2531c5 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -84,7 +84,6 @@ #![feature(cfg_target_has_atomic)] #![feature(coerce_unsized)] #![feature(const_btree_new)] -#![feature(const_generic_impls_guard)] #![feature(const_generics)] #![feature(const_in_array_repeat_expressions)] #![feature(cow_is_borrowed)] diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 77ff567aa7a..96dfc2f4251 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; @@ -1516,10 +1515,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 0cf250576f1..8a5f1ee5076 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}; @@ -2162,10 +2161,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 2f56898f4e9..f5a3d0cd4af 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}; @@ -2378,18 +2377,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")] @@ -2493,10 +2492,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) |
