From f032a84f45d33bf31ac942859abf5761cf7311bb Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Wed, 10 May 2023 15:23:20 -0700 Subject: [PATCH] Remove useless `assume`s from `slice::iter(_mut)` --- core/src/slice/iter.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/src/slice/iter.rs b/core/src/slice/iter.rs index 67fcef0f4..5369fe0a9 100644 --- a/core/src/slice/iter.rs +++ b/core/src/slice/iter.rs @@ -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 } @@ -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 }