Skip to content

Commit

Permalink
remove unnecessary bound on Zip specialization impl
Browse files Browse the repository at this point in the history
I originally added this bound in an attempt to make the specialization
sound for owning iterators but it was never correct here and the correct
and already implemented solution is is to place it on the IntoIter
implementation.
  • Loading branch information
the8472 committed Sep 9, 2021
1 parent 497ee32 commit 4b743bf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions library/core/src/iter/adapters/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,9 @@ where
}
}

// Since SourceIter forwards the left hand side we do the same here
#[unstable(issue = "none", feature = "inplace_iteration")]
// Limited to Item: Copy since interaction between Zip's use of TrustedRandomAccess
// and Drop implementation of the source is unclear.
//
// An additional method returning the number of times the source has been logically advanced
// (without calling next()) would be needed to properly drop the remainder of the source.
unsafe impl<A: InPlaceIterable, B: Iterator> InPlaceIterable for Zip<A, B> where A::Item: Copy {}
unsafe impl<A: InPlaceIterable, B: Iterator> InPlaceIterable for Zip<A, B> {}

#[stable(feature = "rust1", since = "1.0.0")]
impl<A: Debug, B: Debug> Debug for Zip<A, B> {
Expand Down

0 comments on commit 4b743bf

Please sign in to comment.