File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -120,3 +120,13 @@ fn test_double_ended_enumerate() {
120
120
assert_eq ! ( it. next_back( ) , Some ( ( 2 , 3 ) ) ) ;
121
121
assert_eq ! ( it. next( ) , None ) ;
122
122
}
123
+
124
+ #[ test]
125
+ fn test_empty_iterator_enumerate_next_index ( ) {
126
+ let mut it = empty :: < i32 > ( ) . enumerate ( ) ;
127
+ assert_eq ! ( it. next_index( ) , 0 ) ;
128
+ assert_eq ! ( it. next_index( ) , 0 ) ;
129
+ assert_eq ! ( it. next( ) , None ) ;
130
+ assert_eq ! ( it. next_index( ) , 0 ) ;
131
+ assert_eq ! ( it. next_index( ) , 0 ) ;
132
+ }
Original file line number Diff line number Diff line change 63
63
#![ feature( maybe_uninit_write_slice) ]
64
64
#![ feature( min_specialization) ]
65
65
#![ feature( never_type) ]
66
+ #![ feature( next_index) ]
66
67
#![ feature( numfmt) ]
67
68
#![ feature( pattern) ]
68
69
#![ feature( pointer_is_aligned_to) ]
You can’t perform that action at this time.
0 commit comments