Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/test-utils/src/minicore.rs')
| -rw-r--r-- | crates/test-utils/src/minicore.rs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/crates/test-utils/src/minicore.rs b/crates/test-utils/src/minicore.rs index 4a2346193b..4462c2ce1e 100644 --- a/crates/test-utils/src/minicore.rs +++ b/crates/test-utils/src/minicore.rs @@ -1510,7 +1510,7 @@ pub mod iter { impl<T, const N: usize> IntoIterator for [T; N] { type Item = T; type IntoIter = IntoIter<T, N>; - fn into_iter(self) -> I { + fn into_iter(self) -> Self::IntoIter { IntoIter { data: self, range: IndexRange { start: 0, end: loop {} } } } } @@ -1520,6 +1520,29 @@ pub mod iter { loop {} } } + pub struct Iter<'a, T> { + slice: &'a [T], + } + impl<'a, T> IntoIterator for &'a [T; N] { + type Item = &'a T; + type IntoIter = Iter<'a, T>; + fn into_iter(self) -> Self::IntoIter { + loop {} + } + } + impl<'a, T> IntoIterator for &'a [T] { + type Item = &'a T; + type IntoIter = Iter<'a, T>; + fn into_iter(self) -> Self::IntoIter { + loop {} + } + } + impl<'a, T> Iterator for Iter<'a, T> { + type Item = &'a T; + fn next(&mut self) -> Option<T> { + loop {} + } + } } pub use self::collect::IntoIterator; } |