summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-05-10 15:23:20 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-05-12 17:34:55 -0700
commitc50a2e1d1742ca290aed840fb5273662b209b936 (patch)
treecb50892f0302ee9ef8ebde9862877d33b6fb609d /library
parent4a59ba4d54a3ec0d8ea1e82b7eeb5c8b0162de04 (diff)
downloadrust-c50a2e1d1742ca290aed840fb5273662b209b936.tar.gz
Remove useless `assume`s from `slice::iter(_mut)`
Diffstat (limited to 'library')
-rw-r--r--library/core/src/slice/iter.rs4
1 files changed, 0 insertions, 4 deletions
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 }