relax bounds on iterator adapter Default impls

This commit is contained in:
The 8472 2023-02-28 21:16:33 +01:00
parent a4bdfe24c5
commit e44836faf6
6 changed files with 6 additions and 25 deletions

View File

@ -283,11 +283,7 @@ where
}
#[stable(feature = "default_iters", since = "CURRENT_RUSTC_VERSION")]
impl<A, B> Default for Chain<A, B>
where
A: Iterator + Default,
B: Iterator + Default,
{
impl<A: Default, B: Default> Default for Chain<A, B> {
/// Creates a `Chain` from the default values for `A` and `B`.
///
/// ```

View File

@ -155,11 +155,7 @@ where
}
#[stable(feature = "default_iters", since = "CURRENT_RUSTC_VERSION")]
impl<'a, I, T: 'a> Default for Cloned<I>
where
I: Default + Iterator<Item = &'a T>,
T: Clone,
{
impl<I: Default> Default for Cloned<I> {
/// Creates a `Cloned` iterator from the default value of `I`
/// ```
/// # use core::slice;

View File

@ -242,11 +242,7 @@ where
}
#[stable(feature = "default_iters", since = "CURRENT_RUSTC_VERSION")]
impl<'a, I, T: 'a> Default for Copied<I>
where
I: Default + Iterator<Item = &'a T>,
T: Copy,
{
impl<I: Default> Default for Copied<I> {
/// Creates a `Copied` iterator from the default value of `I`
/// ```
/// # use core::slice;

View File

@ -266,10 +266,7 @@ where
unsafe impl<I: InPlaceIterable> InPlaceIterable for Enumerate<I> {}
#[stable(feature = "default_iters", since = "CURRENT_RUSTC_VERSION")]
impl<I> Default for Enumerate<I>
where
I: Iterator + Default,
{
impl<I: Default> Default for Enumerate<I> {
/// Creates an `Enumerate` iterator from the default value of `I`
/// ```
/// # use core::slice;

View File

@ -305,8 +305,7 @@ where
#[stable(feature = "default_iters", since = "CURRENT_RUSTC_VERSION")]
impl<I> Default for Flatten<I>
where
I: Iterator + Default,
<I as Iterator>::Item: IntoIterator,
I: Default + Iterator<Item: IntoIterator>,
{
/// Creates a `Flatten` iterator from the default value of `I`.
///

View File

@ -137,10 +137,7 @@ impl<I> FusedIterator for Rev<I> where I: FusedIterator + DoubleEndedIterator {}
unsafe impl<I> TrustedLen for Rev<I> where I: TrustedLen + DoubleEndedIterator {}
#[stable(feature = "default_iters", since = "CURRENT_RUSTC_VERSION")]
impl<I> Default for Rev<I>
where
I: Default + Iterator,
{
impl<I: Default> Default for Rev<I> {
/// Creates a `Rev` iterator from the default value of `I`
/// ```
/// # use core::slice;