about summary refs log tree commit diff
path: root/library/alloc
diff options
context:
space:
mode:
authorhi-rustin <rustin.liu@gmail.com>2024-02-17 16:11:32 +0800
committerhi-rustin <rustin.liu@gmail.com>2024-02-17 16:20:09 +0800
commit6f1383cf5b036236dc7c72ff7bb68401f5e4169a (patch)
treec2845d9811853bc97a491bf00e690df40f6d77d6 /library/alloc
parentb17491c8f6d555386104dfd82004c01bfef09c95 (diff)
downloadrust-6f1383cf5b036236dc7c72ff7bb68401f5e4169a.tar.gz
rust-6f1383cf5b036236dc7c72ff7bb68401f5e4169a.zip
Remove unnecessary unit binding
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Diffstat (limited to 'library/alloc')
-rw-r--r--library/alloc/src/raw_vec.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 49f5f53f9b3..dd8d6f6c7e6 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -261,7 +261,7 @@ impl<T, A: Allocator> RawVec<T, A> {
             // and could hypothetically handle differences between stride and size, but this memory
             // has already been allocated so we know it can't overflow and currently rust does not
             // support such types. So we can do better by skipping some checks and avoid an unwrap.
-            let _: () = const { assert!(mem::size_of::<T>() % mem::align_of::<T>() == 0) };
+            const { assert!(mem::size_of::<T>() % mem::align_of::<T>() == 0) };
             unsafe {
                 let align = mem::align_of::<T>();
                 let size = mem::size_of::<T>().unchecked_mul(self.cap.0);
@@ -465,7 +465,7 @@ impl<T, A: Allocator> RawVec<T, A> {
 
         let (ptr, layout) = if let Some(mem) = self.current_memory() { mem } else { return Ok(()) };
         // See current_memory() why this assert is here
-        let _: () = const { assert!(mem::size_of::<T>() % mem::align_of::<T>() == 0) };
+        const { assert!(mem::size_of::<T>() % mem::align_of::<T>() == 0) };
 
         // If shrinking to 0, deallocate the buffer. We don't reach this point
         // for the T::IS_ZST case since current_memory() will have returned