1 fn iter_empty_and_zst() {
2 // Iterate over a Unique::empty()
3 for _ in Vec::<u32>::new().iter() {
4 panic!("We should never be here.");
7 // Iterate over a ZST (uses arith_offset internally)
9 for _ in &[(), (), ()] {
15 fn test_iterator_step_by_nth() {
16 let mut it = (0..16).step_by(5);
17 assert_eq!(it.nth(0), Some(0));
18 assert_eq!(it.nth(0), Some(5));
19 assert_eq!(it.nth(0), Some(10));
20 assert_eq!(it.nth(0), Some(15));
21 assert_eq!(it.nth(0), None);
25 let f = |x: &u8| 10u8 == *x;
28 let g = |(), x: &u8| 10u8 == *x;
31 let h = |(), (), x: &u8| 10u8 == *x;
34 [1, 2, 3u8].iter().any(|elt| 10 == *elt);
38 test_iterator_step_by_nth();