about summary refs log tree commit diff
path: root/library/std/src/sys/alloc/unix.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-07 13:47:27 +0000
committerbors <bors@rust-lang.org>2025-03-07 13:47:27 +0000
commit03eb45452305f2d52348279d0caa5fc1f12c438d (patch)
tree74910a87bd9be174a8e61365a82c887cb84178e4 /library/std/src/sys/alloc/unix.rs
parent59a9b9e9d776cb5d6bc02e99c4dce4f94f622232 (diff)
parentacc7de6c77a9b08aab24d2a240f0e781ce5e5766 (diff)
downloadrust-03eb45452305f2d52348279d0caa5fc1f12c438d.tar.gz
rust-03eb45452305f2d52348279d0caa5fc1f12c438d.zip
Auto merge of #138155 - matthiaskrgr:rollup-xq5buio, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #137674 (Enable `f16` for LoongArch)
 - #138034 (library: Use `size_of` from the prelude instead of imported)
 - #138060 (Revert #138019 after further discussion about how hir-pretty printing should work)
 - #138073 (Break critical edges in inline asm before code generation)
 - #138107 (`librustdoc`: clippy fixes)
 - #138111 (Use `default_field_values` for `rustc_errors::Context`, `rustc_session::config::NextSolverConfig` and `rustc_session::config::ErrorOutputType`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/alloc/unix.rs')
-rw-r--r--library/std/src/sys/alloc/unix.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/alloc/unix.rs b/library/std/src/sys/alloc/unix.rs
index 1af9d766290..a7ac4117ec9 100644
--- a/library/std/src/sys/alloc/unix.rs
+++ b/library/std/src/sys/alloc/unix.rs
@@ -81,7 +81,7 @@ cfg_if::cfg_if! {
             // while others require the alignment to be at least the pointer size (Illumos, macOS).
             // posix_memalign only has one, clear requirement: that the alignment be a multiple of
             // `sizeof(void*)`. Since these are all powers of 2, we can just use max.
-            let align = layout.align().max(crate::mem::size_of::<usize>());
+            let align = layout.align().max(size_of::<usize>());
             let ret = unsafe { libc::posix_memalign(&mut out, align, layout.size()) };
             if ret != 0 { ptr::null_mut() } else { out as *mut u8 }
         }