aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/minicore.rs27
1 files changed, 26 insertions, 1 deletions
diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs
index a861ff09c..2f0da7fe5 100644
--- a/crates/test_utils/src/minicore.rs
+++ b/crates/test_utils/src/minicore.rs
@@ -209,8 +209,29 @@ pub mod task {
209 209
210// region:iterator 210// region:iterator
211pub mod iter { 211pub mod iter {
212 mod adapters {
213 pub struct Take<I> {
214 iter: I,
215 n: usize,
216 }
217
218 impl<I> Iterator for Take<I>
219 where
220 I: Iterator,
221 {
222 type Item = <I as Iterator>::Item;
223
224 fn next(&mut self) -> Option<<I as Iterator>::Item> {
225 loop {}
226 }
227 }
228 }
229 pub use self::adapters::Take;
230
212 mod traits { 231 mod traits {
213 mod iterator { 232 mod iterator {
233 use super::super::Take;
234
214 pub trait Iterator { 235 pub trait Iterator {
215 type Item; 236 type Item;
216 #[lang = "next"] 237 #[lang = "next"]
@@ -218,8 +239,13 @@ pub mod iter {
218 fn nth(&mut self, n: usize) -> Option<Self::Item> { 239 fn nth(&mut self, n: usize) -> Option<Self::Item> {
219 loop {} 240 loop {}
220 } 241 }
242 fn take(self, n: usize) -> crate::iter::Take<Self> {
243 loop {}
244 }
221 } 245 }
222 } 246 }
247 pub use self::iterator::Iterator;
248
223 mod collect { 249 mod collect {
224 pub trait IntoIterator { 250 pub trait IntoIterator {
225 type Item; 251 type Item;
@@ -236,7 +262,6 @@ pub mod iter {
236 } 262 }
237 } 263 }
238 pub use self::collect::IntoIterator; 264 pub use self::collect::IntoIterator;
239 pub use self::iterator::Iterator;
240 } 265 }
241 pub use self::traits::{IntoIterator, Iterator}; 266 pub use self::traits::{IntoIterator, Iterator};
242} 267}