From c50a2e1d1742ca290aed840fb5273662b209b936 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Wed, 10 May 2023 15:23:20 -0700 Subject: Remove useless `assume`s from `slice::iter(_mut)` --- library/core/src/slice/iter.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'library') diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index 67fcef0f466..5369fe0a9a9 100644 --- a/library/core/src/slice/iter.rs +++ b/library/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 } -- cgit v1.2.1