summary refs log tree commit diff
path: root/src/libcore/tests
diff options
context:
space:
mode:
authorShotaro Yamada <sinkuu@sinkuu.xyz>2018-12-17 09:35:28 +0900
committerShotaro Yamada <sinkuu@sinkuu.xyz>2018-12-17 15:00:22 +0900
commitf0483f76e6feb256abffb060029f57e09c6d4dc0 (patch)
treee7d9edd2e9210e704510083a7cade3d63e765ac2 /src/libcore/tests
parent1897657ef09eea3d0b0afbbbd154a12fbb8fbf3f (diff)
downloadrust-f0483f76e6feb256abffb060029f57e09c6d4dc0.tar.gz
rust-f0483f76e6feb256abffb060029f57e09c6d4dc0.zip
Remove `<Cycle as Iterator>::try_fold` override
It was a incorrect optimization.
Diffstat (limited to 'src/libcore/tests')
-rw-r--r--src/libcore/tests/iter.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/tests/iter.rs b/src/libcore/tests/iter.rs
index 4efa0136314..00b4aa4fa2d 100644
--- a/src/libcore/tests/iter.rs
+++ b/src/libcore/tests/iter.rs
@@ -1003,6 +1003,8 @@ fn test_cycle() {
     assert_eq!(it.next(), None);
 
     assert_eq!(empty::<i32>().cycle().fold(0, |acc, x| acc + x), 0);
+
+    assert_eq!(once(1).cycle().skip(1).take(4).fold(0, |acc, x| acc + x), 4);
 }
 
 #[test]