about summary refs log tree commit diff
path: root/src/libcore/iter.rs
AgeCommit message (Collapse)AuthorLines
2016-04-18Split core::iter module implementation into partsUlrik Sverdrup-5012/+0
split iter.rs into a directory of (implementation private) modules. + mod Adaptor structs - Private fields need to be available both for them and Iterator + iterator (Iterator trait) + traits (FromIterator, traits but Iterator itself) + range (range related) + sources (Repeat, Once, Empty)
2016-04-16Add a note about side effects for "peekable" iteratorsTobias Bucher-2/+7
2016-03-28Auto merge of #32438 - kamalmarhubi:intoiterator-example, r=steveklabnikbors-6/+6
style: Use `iter` for IntoIterator parameter names This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-28style: Use `iter` for IntoIterator parameter namesKamal Marhubi-6/+6
This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-27Extend linkchecker with anchor checkingmitaa-2/+2
This adds checks to ensure that: * link anchors refer to existing id's on the target page * id's are unique within an html document * page redirects are valid
2016-03-20libcore: add Debug implementations to most missing typesSean McArthur-14/+101
2016-03-12std: Clean out deprecated APIsAlex Crichton-26/+0
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-11std: Add a tracking issue for Peekable::is_emptyAlex Crichton-1/+1
The listed tracking issue was hooked up to the wrong location by accident.
2016-03-08doc: Fix a bunch of broken linksAlex Crichton-9/+9
A few categories: * Links into compiler docs were just all removed as we're not generating compiler docs. * Move up one more level to forcibly go to std docs to fix inlined documentation across the facade crates.
2016-03-07Auto merge of #32051 - steveklabnik:gh9447, r=blussbors-1/+1
Fixes #9447
2016-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-93/+214
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-03-05Auto merge of #31700 - oli-obk:skip_double_ended, r=alexcrichtonbors-0/+11
[Playground Example](https://play.rust-lang.org/?gist=66fdb4fe1cf4d8aa2ad4&version=stable)
2016-03-04remove under/overflow from next_back/nextAlex Burka-6/+10
2016-03-04End stdlib module summaries with a full stop.Steve Klabnik-1/+1
Fixes #9447
2016-03-04make skip a double ended iteratorOliver Schneider-0/+11
2016-03-04Clarify ambiguous wording in fold() docsBrian Bowman-1/+1
To me it was unclear whether 'it' referred to the fold function, or the closure.
2016-02-27Make for loop desugaring for iterators more preciseUlrik Sverdrup-1/+1
The UFCS call IntoIterator::into_iter() is used by the for loop.
2016-02-27fix underflow in DoubleEndedIterator::next_backAlex Burka-5/+9
2016-02-27add StepBy for RangeInclusiveAlex Burka-4/+108
2016-02-27note work still to be doneAlex Burka-1/+3
In particular, uses of inclusive ranges within the standard library are still waiting. Slices and collections can be sliced with `usize` and `Range*<usize>`, but not yet `Range*Inclusive<usize>`. Also, we need to figure out what to do about `RangeArgument`. Currently it has `start()` and `end()` methods which are pretty much identical to `Range::start` and `Range::end`. For the same reason as Range itself, these methods can't express a range such as `0...255u8` without overflow. The easiest choice, it seems to me, is either changing the meaning of `end()` to be inclusive, or adding a new method, say `last()`, that is inclusive and specifying that `end()` returns `None` in cases where it would overflow. Changing the semantics would be a breaking change, but `RangeArgument` is unstable so maybe we should do it anyway.
2016-02-27core: add inclusive ranges to core::opsAlex Burka-89/+96
Since it removes the old iter::{range_inclusive, RangeInclusive} which were unstable and deprecated, this is a [breaking-change] on nightly.
2016-02-22Correct Iterator trait documentationMichael Huynh-7/+7
Fixes several minor spelling errors and includes a suggested style fix.
2016-02-03Rollup merge of #31351 - steveklabnik:gh31318, r=alexcrichtonManish Goregaokar-0/+24
This is a behavior that some find confusing, so it deserves its own example. Fixes #31318 I think this wording might be a bit strange, but I couldn't come up with anything better. Feedback very welcome.
2016-02-03Rollup merge of #31220 - steveklabnik:gh30632, r=nikomatsakisManish Goregaokar-0/+43
Fixes #30632 I'm not sure if this explanation is good enough. If it is, I will add it to filter as well.
2016-02-01Further explain take_whileSteve Klabnik-0/+24
This is a behavior that some find confusing, so it deserves its own example. Fixes #31318
2016-02-01Discuss pitfalls of stateful closures with MapSteve Klabnik-0/+43
Fixes #30632
2016-02-01doc: bindings not needed for this exampleTshepang Lekhonkhobe-28/+10
2016-01-26RangeFrom::step_by docs: fix exampleSimon Sapin-3/+5
The previous example did not do what its description said. In it panicked on integer overflow in debug mode, and went into an infinite loop in release mode (wrapping back to 0 after printing 254).
2016-01-25Describe next_back() wrt Iterator protocolSteve Klabnik-0/+6
Fixes #30633
2016-01-13Fix some broken and missing links in the docsOliver Middleton-1/+1
2016-01-10Remove unneeded #[lang = "iterator"]Guillaume Gomez-1/+0
2016-01-04Feature-gate defaulted type parameters outside of types.Niko Matsakis-2/+2
2015-12-30Rollup merge of #30373 - ChrisBuchholz:master, r=steveklabnikSteve Klabnik-7/+13
The current explanation for scan() is not very clear as to how it works, especially when it compares itself to fold(). I believe these changes makes it all a bit more clear for the reader, and makes it easier to understand the example code. r? @steveklabnik
2015-12-15Clearer leading sentenceChristoffer Buchholz-2/+2
2015-12-15Remove emoji from docsmitaa-1/+1
2015-12-14make scan() usage more explanatoryChris Buchholz-7/+13
2015-12-10std: Remove deprecated functionality from 1.5Alex Crichton-84/+0
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-09doc: these are just renames, so avoid duplicationTshepang Lekhonkhobe-30/+2
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-2/+45
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-29libcore/iter: fix typosIvan Stankovic-4/+4
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-5/+5
2015-11-18Auto merge of #29083 - petrochenkov:stability3, r=alexcrichtonbors-0/+10
What this patch does: - Stability annotations are now based on "exported items" supplied by rustc_privacy and not "public items". Exported items are as accessible for external crates as directly public items and should be annotated with stability attributes. - Trait impls require annotations now. - Reexports require annotations now. - Crates themselves didn't require annotations, now they do. - Exported macros are annotated now, but these annotations are not used yet. - Some useless annotations are detected and result in errors - Finally, some small bugs are fixed - deprecation propagates from stable deprecated parents, items in blocks are traversed correctly (fixes https://github.com/rust-lang/rust/issues/29034) + some code cleanup.
2015-11-17More docs for FromIteratorSteve Klabnik-16/+132
And modifying IntoIterator for consisntency with it. Part of #29360
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+10
2015-11-12libcore: deny warnings in doctestsKevin Butler-3/+5
2015-11-10Some cleanup on after #29684Steve Klabnik-14/+13
* wrap to 80 cols * small grammar fix, missing 'the'
2015-11-08Explain that size_hint cannot be trustedStepan Koltsov-0/+23
Same applies to `len()` function of `ExactSizeIterator` trait.
2015-11-07Remove duplicate words from docsAndrew Paseltiner-2/+2
2015-11-06Auto merge of #29643 - petrochenkov:stability5, r=alexcrichtonbors-1/+0
Also remove `stable` stability annotations from inherent impls (There will be a warning for useless stability annotations soon.) r? @Gankro
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-1/+0
Remove `stable` stability annotations from inherent impls