@@ -124,12 +124,10 @@ macro_rules! iterator {
124
124
fn next( & mut self ) -> Option <$elem> {
125
125
// could be implemented with slices, but this avoids bounds checks
126
126
127
- // SAFETY: `assume` calls are safe since a slice's start pointer
128
- // must be non-null, and slices over non-ZSTs must also have a
129
- // non-null end pointer. The call to `next_unchecked!` is safe
130
- // since we check if the iterator is empty first.
127
+ // SAFETY: `assume` call is safe because slices over non-ZSTs must
128
+ // have a non-null end pointer. The call to `next_unchecked!` is
129
+ // safe since we check if the iterator is empty first.
131
130
unsafe {
132
- assume( !self . ptr. as_ptr( ) . is_null( ) ) ;
133
131
if !<T >:: IS_ZST {
134
132
assume( !self . end. is_null( ) ) ;
135
133
}
@@ -339,12 +337,10 @@ macro_rules! iterator {
339
337
fn next_back( & mut self ) -> Option <$elem> {
340
338
// could be implemented with slices, but this avoids bounds checks
341
339
342
- // SAFETY: `assume` calls are safe since a slice's start pointer must be non-null,
343
- // and slices over non-ZSTs must also have a non-null end pointer.
344
- // The call to `next_back_unchecked!` is safe since we check if the iterator is
345
- // empty first.
340
+ // SAFETY: `assume` call is safe because slices over non-ZSTs must
341
+ // have a non-null end pointer. The call to `next_back_unchecked!`
342
+ // is safe since we check if the iterator is empty first.
346
343
unsafe {
347
- assume( !self . ptr. as_ptr( ) . is_null( ) ) ;
348
344
if !<T >:: IS_ZST {
349
345
assume( !self . end. is_null( ) ) ;
350
346
}
0 commit comments