Skip to content

Commit c173688

Browse files
Add optimizer hints
1 parent 309b591 commit c173688

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/iterators.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,11 @@ impl<T: Clone, const N: usize> Clone for StaticVecIntoIter<T, N> {
655655
data: {
656656
let mut data = MaybeUninit::<[T; N]>::uninit();
657657
let new_data_ptr = data.as_mut_ptr() as *mut T;
658+
// Guaranteed safe assumption in this context.
659+
assume(!new_data_ptr.is_null());
658660
let self_data_ptr = self.data.as_ptr() as *const T;
661+
// Guaranteed safe assumption in this context.
662+
assume(!self_data_ptr.is_null());
659663
for i in self.start..self.end {
660664
unsafe { new_data_ptr.add(i).write((&*self_data_ptr.add(i)).clone()) };
661665
}

0 commit comments

Comments
 (0)