Skip to content

Commit f032a84

Browse files
committed
Remove useless assumes from slice::iter(_mut)
1 parent 83b7d71 commit f032a84

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

core/src/slice/iter.rs

-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ impl<'a, T> Iter<'a, T> {
9090
let ptr = slice.as_ptr();
9191
// SAFETY: Similar to `IterMut::new`.
9292
unsafe {
93-
assume(!ptr.is_null());
94-
9593
let end = if T::IS_ZST { invalid(slice.len()) } else { ptr.add(slice.len()) };
9694

9795
Self { ptr: NonNull::new_unchecked(ptr as *mut T), end, _marker: PhantomData }
@@ -228,8 +226,6 @@ impl<'a, T> IterMut<'a, T> {
228226
// See the `next_unchecked!` and `is_empty!` macros as well as the
229227
// `post_inc_start` method for more information.
230228
unsafe {
231-
assume(!ptr.is_null());
232-
233229
let end = if T::IS_ZST { invalid_mut(slice.len()) } else { ptr.add(slice.len()) };
234230

235231
Self { ptr: NonNull::new_unchecked(ptr), end, _marker: PhantomData }

0 commit comments

Comments
 (0)