rust/src/libcore/tests
Mazdak Farrokhzad fe998dbfe4
Rollup merge of #61457 - timvermeulen:double_ended_iters, r=scottmcm
Implement DoubleEndedIterator for iter::{StepBy, Peekable, Take}

Now that `DoubleEndedIterator::nth_back` has landed, `StepBy` and `Take` can have an efficient `DoubleEndedIterator` implementation. I don't know if there was any particular reason for `Peekable` not having a `DoubleEndedIterator` implementation, but it's quite trivial and I don't see any drawbacks to having it.

I'm not very happy about the implementation of `Peekable::try_rfold`, but I didn't see another way to only take the value out of `self.peeked` in case `self.iter.try_rfold` didn't exit early.

I only added `Peekable::rfold` (in addition to `try_rfold`) because its `Iterator` implementation has both `fold` and `try_fold` (and for similar reasons I added `Take::try_rfold` but not `Take::rfold`). Do we have any guidelines on whether we want both? If we do want both, maybe we should investigate which iterator adaptors override `try_fold` but not `fold` and add the missing implementations. At the moment I think that it's better to always have iterator adaptors implement both, because some iterators have a simpler `fold` implementation than their `try_fold` implementation.

The tests that I added may not be sufficient because they're all just existing tests where `next`/`nth`/`fold`/`try_fold` are replaced by their DEI counterparts, but I do think all paths are covered. Is there anything in particular that I should probably also test?
2019-08-06 08:17:31 +02:00
..
fmt Rollup merge of #60458 - KodrAus:debug_map_entry, r=alexcrichton 2019-07-09 04:52:35 +02:00
hash review or fix remaining miri failures in libcore 2019-02-13 18:21:13 +01:00
num Miri: disable a slow test 2019-06-09 14:04:30 +02:00
alloc.rs Add const_unchecked_layout test to libcore/tests 2019-05-14 09:41:50 +02:00
any.rs Remove licenses 2018-12-25 21:08:33 -07:00
array.rs Remove licenses 2018-12-25 21:08:33 -07:00
ascii.rs Fix mismatching Kleene operators 2019-07-03 00:37:25 +02:00
atomic.rs Remove licenses 2018-12-25 21:08:33 -07:00
cell.rs Deny rust_2018_idioms in libcore tests 2019-04-20 18:44:29 +02:00
char.rs Remove copy paste error in char tests 2019-02-27 14:44:20 +01:00
clone.rs Remove licenses 2018-12-25 21:08:33 -07:00
cmp.rs Remove licenses 2018-12-25 21:08:33 -07:00
intrinsics.rs Remove licenses 2018-12-25 21:08:33 -07:00
iter.rs Rollup merge of #61457 - timvermeulen:double_ended_iters, r=scottmcm 2019-08-06 08:17:31 +02:00
lib.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
manually_drop.rs Remove licenses 2018-12-25 21:08:33 -07:00
mem.rs Remove licenses 2018-12-25 21:08:33 -07:00
nonzero.rs fixed tests again 2019-02-28 21:00:41 +01:00
ops.rs Import Bound in tests 2019-05-31 16:56:26 -05:00
option.rs renamed inner_deref feature's deref*() methods as_deref*() as per discussion https://github.com/rust-lang/rust/issues/50264 2019-07-18 15:17:30 +09:00
pattern.rs Fix mismatching Kleene operators 2019-07-03 00:37:25 +02:00
ptr.rs enable a few more tests in Miri and update the comment for others 2019-07-03 19:58:59 +02:00
result.rs renamed inner_deref feature's deref*() methods as_deref*() as per discussion https://github.com/rust-lang/rust/issues/50264 2019-07-18 15:17:30 +09:00
slice.rs Rollup merge of #62074 - wizAmit:feature/mut_chunks_nth_back, r=scottmcm 2019-07-28 03:01:44 +02:00
str.rs Remove licenses 2018-12-25 21:08:33 -07:00
str_lossy.rs Remove licenses 2018-12-25 21:08:33 -07:00
time.rs we can now skip should_panic tests with the libtest harness 2019-03-10 17:47:42 +01:00
tuple.rs Refactor tuple comparison tests 2019-03-25 13:00:57 -04:00