mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
internal: switch some tests to minicore
This commit is contained in:
parent
7b4f5c0262
commit
9b3aa591cd
3 changed files with 50 additions and 17 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue