internal: switch some tests to minicore

This commit is contained in:
Aleksey Kladov 2021-06-17 11:18:37 +03:00
parent 7b4f5c0262
commit 9b3aa591cd
3 changed files with 50 additions and 17 deletions

View file

@ -228,6 +228,28 @@ pub mod iter {
}
pub use self::adapters::Take;
mod sources {
mod repeat {
pub fn repeat<T>(elt: T) -> Repeat<T> {
loop {}
}
pub struct Repeat<A> {
element: A,
}
impl<A> Iterator for Repeat<A> {
type Item = A;
fn next(&mut self) -> Option<A> {
loop {}
}
}
}
pub use self::repeat::{repeat, Repeat};
}
pub use self::sources::{repeat, Repeat};
mod traits {
mod iterator {
use super::super::Take;
@ -242,6 +264,18 @@ pub mod iter {
fn take(self, n: usize) -> crate::iter::Take<Self> {
loop {}
}
fn by_ref(&mut self) -> &mut Self
where
Self: Sized,
{
self
}
}
impl<I: Iterator + ?Sized> Iterator for &mut I {
type Item = I::Item;
fn next(&mut self) -> Option<I::Item> {
(**self).next()
}
}
}
pub use self::iterator::Iterator;