Skip to content

Commit

Permalink
Remove useless assumes from slice::iter(_mut)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed May 13, 2023
1 parent 83b7d71 commit f032a84
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions core/src/slice/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ impl<'a, T> Iter<'a, T> {
let ptr = slice.as_ptr();
// SAFETY: Similar to `IterMut::new`.
unsafe {
assume(!ptr.is_null());

let end = if T::IS_ZST { invalid(slice.len()) } else { ptr.add(slice.len()) };

Self { ptr: NonNull::new_unchecked(ptr as *mut T), end, _marker: PhantomData }
Expand Down Expand Up @@ -228,8 +226,6 @@ impl<'a, T> IterMut<'a, T> {
// See the `next_unchecked!` and `is_empty!` macros as well as the
// `post_inc_start` method for more information.
unsafe {
assume(!ptr.is_null());

let end = if T::IS_ZST { invalid_mut(slice.len()) } else { ptr.add(slice.len()) };

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

0 comments on commit f032a84

Please sign in to comment.