mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 04:55:22 +03:00
Move TrustedLen and FusedIterator impl of Iter/IterMut into macro
This commit is contained in:
@@ -2513,6 +2513,12 @@ fn rfold<Acc, Fold>(mut self, init: Acc, mut f: Fold) -> Acc
|
||||
accum
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "fused", since = "1.26.0")]
|
||||
impl<'a, T> FusedIterator for $name<'a, T> {}
|
||||
|
||||
#[unstable(feature = "trusted_len", issue = "37572")]
|
||||
unsafe impl<'a, T> TrustedLen for $name<'a, T> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2639,12 +2645,6 @@ fn is_empty(&self) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "fused", since = "1.26.0")]
|
||||
impl<'a, T> FusedIterator for Iter<'a, T> {}
|
||||
|
||||
#[unstable(feature = "trusted_len", issue = "37572")]
|
||||
unsafe impl<'a, T> TrustedLen for Iter<'a, T> {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<'a, T> Clone for Iter<'a, T> {
|
||||
fn clone(&self) -> Iter<'a, T> { Iter { ptr: self.ptr, end: self.end, _marker: self._marker } }
|
||||
@@ -2767,13 +2767,6 @@ fn is_empty(&self) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "fused", since = "1.26.0")]
|
||||
impl<'a, T> FusedIterator for IterMut<'a, T> {}
|
||||
|
||||
#[unstable(feature = "trusted_len", issue = "37572")]
|
||||
unsafe impl<'a, T> TrustedLen for IterMut<'a, T> {}
|
||||
|
||||
|
||||
// Return the number of elements of `T` from `start` to `end`.
|
||||
// Return the arithmetic difference if `T` is zero size.
|
||||
#[inline(always)]
|
||||
|
||||
Reference in New Issue
Block a user