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() {
120120 assert_eq ! ( it. next_back( ) , Some ( ( 2 , 3 ) ) ) ;
121121 assert_eq ! ( it. next( ) , None ) ;
122122}
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 6363#![ feature( maybe_uninit_write_slice) ]
6464#![ feature( min_specialization) ]
6565#![ feature( never_type) ]
66+ #![ feature( next_index) ]
6667#![ feature( numfmt) ]
6768#![ feature( pattern) ]
6869#![ feature( pointer_is_aligned_to) ]
You can’t perform that action at this time.
0 commit comments