]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/slice/rotate.rs
Rollup merge of #101774 - Riolku:atomic-update-aba, r=m-ou-se
[rust.git] / library / core / src / slice / rotate.rs
index 4589c6c0f04a5fe836124c5db70190a0c3c8ce5b..fa8c238f8e7a27bf9998bc188f173c30bb7948d4 100644 (file)
@@ -1,5 +1,5 @@
 use crate::cmp;
-use crate::mem::{self, MaybeUninit};
+use crate::mem::{self, MaybeUninit, SizedTypeProperties};
 use crate::ptr;
 
 /// Rotates the range `[mid-left, mid+right)` such that the element at `mid` becomes the first
@@ -63,7 +63,7 @@
 /// when `left < right` the swapping happens from the left instead.
 pub unsafe fn ptr_rotate<T>(mut left: usize, mut mid: *mut T, mut right: usize) {
     type BufType = [usize; 32];
-    if mem::size_of::<T>() == 0 {
+    if T::IS_ZST {
         return;
     }
     loop {