mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-23 03:44:23 +00:00
internal: minimize minicore
We want to keep minicore small, so let's split out iterator adapters and sources into a separate `iterators` region, and use them only when needed.
This commit is contained in:
parent
9b3aa591cd
commit
c42cdff3d2
3 changed files with 36 additions and 59 deletions
|
@ -21,6 +21,7 @@
|
|||
//! option:
|
||||
//! result:
|
||||
//! iterator: option
|
||||
//! iterators: iterator
|
||||
|
||||
pub mod marker {
|
||||
// region:sized
|
||||
|
@ -209,6 +210,7 @@ pub mod task {
|
|||
|
||||
// region:iterator
|
||||
pub mod iter {
|
||||
// region:iterators
|
||||
mod adapters {
|
||||
pub struct Take<I> {
|
||||
iter: I,
|
||||
|
@ -249,6 +251,7 @@ pub mod iter {
|
|||
pub use self::repeat::{repeat, Repeat};
|
||||
}
|
||||
pub use self::sources::{repeat, Repeat};
|
||||
// endregion:iterators
|
||||
|
||||
mod traits {
|
||||
mod iterator {
|
||||
|
@ -261,15 +264,17 @@ pub mod iter {
|
|||
fn nth(&mut self, n: usize) -> Option<Self::Item> {
|
||||
loop {}
|
||||
}
|
||||
fn take(self, n: usize) -> crate::iter::Take<Self> {
|
||||
loop {}
|
||||
}
|
||||
fn by_ref(&mut self) -> &mut Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
self
|
||||
}
|
||||
// region:iterators
|
||||
fn take(self, n: usize) -> crate::iter::Take<Self> {
|
||||
loop {}
|
||||
}
|
||||
// endregion:iterators
|
||||
}
|
||||
impl<I: Iterator + ?Sized> Iterator for &mut I {
|
||||
type Item = I::Item;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue