about summary refs log tree commit diff
path: root/src/libcoretest/iter.rs
AgeCommit message (Collapse)AuthorLines
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-15/+15
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-1/+1
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-4/+4
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-23Auto merge of #21453 - Stebalien:exactsize, r=alexcrichtonbors-4/+57
Specifically: * Peekable * ByRef * Skip * Take * Fuse Fixes #20547
2015-01-21Add test cases for ExactSizeIterator implsSteven Allen-4/+57
ByRef is not tested included because it is a trivial pass through.
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-1/+1
2015-01-12cleanup: `&foo[0..a]` -> `&foo[..a]`Jorge Aparicio-10/+10
2015-01-07falloutNick Cameron-18/+17
2015-01-07Replace full slice notation with index callsNick Cameron-14/+14
2015-01-05More test fixes!Alex Crichton-1/+1
2015-01-03Remove deprecated functionalityAlex Crichton-1/+1
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03coretest: fix falloutJorge Aparicio-1/+3
2015-01-02rollup merge of #20386: frewsxcv/rm-reexportsAlex Crichton-0/+1
Part of #19253 [breaking-change]
2015-01-02Fallout - change array syntax to use `;`Nick Cameron-2/+2
2014-12-31Remove core::iter::MinMaxResult::* public reexportCorey Farwell-0/+1
Part of #19253 [breaking-change]
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-10/+10
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-13libcoretest: use tuple indexingJorge Aparicio-1/+1
2014-12-13libcoretest: fix falloutJorge Aparicio-1/+1
2014-11-18add Cloned iterator adaptorAlexis Beingessner-0/+17
2014-11-17Fix fallout from coercion removalNick Cameron-3/+3
2014-11-14Revert the need for initial values with arithmetic iteratorsBrendan Zabarauskas-6/+6
2014-11-13Remove Signed trait and add SignedInt traitBrendan Zabarauskas-0/+1
The methods have been moved into Float and SignedInt
2014-11-13Remove lots of numeric traits from the preludesBrendan Zabarauskas-46/+0
Num, NumCast, Unsigned, Float, Primitive and Int have been removed.
2014-11-13Deprecate Zero and One traitsBrendan Zabarauskas-6/+6
2014-11-05Repair various cases where values of distinct types were being operatedNiko Matsakis-4/+4
upon (e.g., `&int` added to `int`).
2014-10-30Add a `repeat` function to the preludeJakub Bukaj-0/+8
Implements a part of RFC 235. [breaking-change]
2014-10-29Rename fail! to panic!Steve Klabnik-6/+6
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-13Clean up rustc warnings.NODA, Kai-1/+1
compiletest: compact "linux" "macos" etc.as "unix". liballoc: remove a superfluous "use". libcollections: remove invocations of deprecated methods in favor of their suggested replacements and use "_" for a loop counter. libcoretest: remove invocations of deprecated methods; also add "allow(deprecated)" for testing a deprecated method itself. libglob: use "cfg_attr". libgraphviz: add a test for one of data constructors. libgreen: remove a superfluous "use". libnum: "allow(type_overflow)" for type cast into u8 in a test code. librustc: names of static variables should be in upper case. libserialize: v[i] instead of get(). libstd/ascii: to_lowercase() instead of to_lower(). libstd/bitflags: modify AnotherSetOfFlags to use i8 as its backend. It will serve better for testing various aspects of bitflags!. libstd/collections: "allow(deprecated)" for testing a deprecated method itself. libstd/io: remove invocations of deprecated methods and superfluous "use". Also add #[test] where it was missing. libstd/num: introduce a helper function to effectively remove invocations of a deprecated method. libstd/path and rand: remove invocations of deprecated methods and superfluous "use". libstd/task and libsync/comm: "allow(deprecated)" for testing a deprecated method itself. libsync/deque: remove superfluous "unsafe". libsync/mutex and once: names of static variables should be in upper case. libterm: introduce a helper function to effectively remove invocations of a deprecated method. We still see a few warnings about using obsoleted native::task::spawn() in the test modules for libsync. I'm not sure how I should replace them with std::task::TaksBuilder and native::task::NativeTaskBuilder (dependency to libstd?) Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-10-07Rename slicing methodsNick Cameron-2/+2
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-25/+26
2014-10-02rollup merge of #17666 : eddyb/take-garbage-outAlex Crichton-3/+2
Conflicts: src/libcollections/lib.rs src/libcore/lib.rs src/librustdoc/lib.rs src/librustrt/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/test/run-pass/issue-8898.rs
2014-10-02Revert "Use slice syntax instead of slice_to, etc."Aaron Turon-26/+25
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
2014-10-02Revert "Remove the `_` suffix from slice methods."Aaron Turon-2/+2
This reverts commit df2f1fa7680a86ba228f004e7de731e91a1df1fe.
2014-10-02tests: remove uses of Gc.Eduard Burtescu-3/+2
2014-10-02Remove the `_` suffix from slice methods.Nick Cameron-2/+2
Deprecates slicing methods from ImmutableSlice/MutableSlice in favour of slicing syntax or the methods in Slice/SliceMut. Closes #17273.
2014-10-02Use slice syntax instead of slice_to, etc.Nick Cameron-25/+26
2014-09-16Fallout from renamingAaron Turon-1/+1
2014-09-07Flip arguments to `std::iter::iterate`.Jonas Hietala-1/+1
Breaks `iterate(f, seed)`, use `iterate(seed, f)` instead. The convention is to have the closure last. Closes #17066. [breaking-change]
2014-08-26Rebasing changesNick Cameron-2/+2
2014-08-06core: Refactor iteratorsPiotr Czarnecki-0/+31
Simplifying the code of methods: nth, fold, rposition and iterators: Filter, FilterMap, SkipWhile Adding basic benchmarks
2014-07-24librustc: Stop desugaring `for` expressions and translate them directly.Patrick Walton-4/+4
This makes edge cases in which the `Iterator` trait was not in scope and/or `Option` or its variants were not in scope work properly. This breaks code that looks like: struct MyStruct { ... } impl MyStruct { fn next(&mut self) -> Option<int> { ... } } for x in MyStruct { ... } { ... } Change ad-hoc `next` methods like the above to implementations of the `Iterator` trait. For example: impl Iterator<int> for MyStruct { fn next(&mut self) -> Option<int> { ... } } Closes #15392. [breaking-change]
2014-07-13Add an iterate function to core::iterJakub Wieczorek-0/+9
Implementation by Kevin Ballard. The function returns an Unfold iterator producing an infinite stream of results of repeated applications of the function, starting from the provided seed value.
2014-06-29Implement RFC#28: Add PartialOrd::partial_cmpSteven Fackler-2/+2
I ended up altering the semantics of Json's PartialOrd implementation. It used to be the case that Null < Null, but I can't think of any reason for an ordering other than the default one so I just switched it over to using the derived implementation. This also fixes broken `PartialOrd` implementations for `Vec` and `TreeMap`. RFC: 0028-partial-cmp
2014-06-29Extract tests from libcore to a separate crateSteven Fackler-0/+835
Libcore's test infrastructure is complicated by the fact that many lang items are defined in the crate. The current approach (realcore/realstd imports) is hacky and hard to work with (tests inside of core::cmp haven't been run for months!). Moving tests to a separate crate does mean that they can only test the public API of libcore, but I don't feel that that is too much of an issue. The only tests that I had to get rid of were some checking the various numeric formatters, but those are also exercised through normal format! calls in other tests.