about summary refs log tree commit diff
path: root/library/std/src/sys/pal/windows/api.rs
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2025-03-04 20:28:38 -0800
committerThalia Archibald <thalia@archibald.dev>2025-03-06 20:20:38 -0800
commit988eb1997014987caad878699ee1e7c000214508 (patch)
tree18f3a0bc36f4f660467f921878f917b36f13c8d0 /library/std/src/sys/pal/windows/api.rs
parent08db600e8e276b548e986abe7239c2a85d2f425f (diff)
downloadrust-988eb1997014987caad878699ee1e7c000214508.tar.gz
rust-988eb1997014987caad878699ee1e7c000214508.zip
library: Use size_of from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
Diffstat (limited to 'library/std/src/sys/pal/windows/api.rs')
-rw-r--r--library/std/src/sys/pal/windows/api.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/windows/api.rs b/library/std/src/sys/pal/windows/api.rs
index ebe207fde93..6b5f9aeace2 100644
--- a/library/std/src/sys/pal/windows/api.rs
+++ b/library/std/src/sys/pal/windows/api.rs
@@ -137,7 +137,7 @@ pub const fn to_utf16<const UTF16_LEN: usize>(s: &str) -> [u16; UTF16_LEN] {
 /// use frequent `as` casts. This is risky because they are too powerful.
 /// For example, the following will compile today:
 ///
-/// `std::mem::size_of::<u64> as u32`
+/// `size_of::<u64> as u32`
 ///
 /// Note that `size_of` is never actually called, instead a function pointer is
 /// converted to a `u32`. Clippy would warn about this but, alas, it's not run
@@ -147,7 +147,7 @@ const fn win32_size_of<T: Sized>() -> u32 {
     // Uses a trait to workaround restriction on using generic types in inner items.
     trait Win32SizeOf: Sized {
         const WIN32_SIZE_OF: u32 = {
-            let size = core::mem::size_of::<Self>();
+            let size = size_of::<Self>();
             assert!(size <= u32::MAX as usize);
             size as u32
         };