diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2025-03-10 10:41:53 +0200 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2025-03-10 10:41:53 +0200 |
| commit | e1da1b09bfcc94a109c01f19923d6ba4a3994915 (patch) | |
| tree | 99dbdd51585c5e7c1fd6bb15463fe61b1363b24b /library/std/src/sys/alloc | |
| parent | fdee1c1455481516e61381dcd93a0adab2b64dbf (diff) | |
| parent | 2c6a12ec44d0426c8939123c2f2cf27d2217de13 (diff) | |
| download | rust-e1da1b09bfcc94a109c01f19923d6ba4a3994915.tar.gz rust-e1da1b09bfcc94a109c01f19923d6ba4a3994915.zip | |
Merge from rust-lang/rust
Diffstat (limited to 'library/std/src/sys/alloc')
| -rw-r--r-- | library/std/src/sys/alloc/unix.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/alloc/windows/tests.rs | 5 |
2 files changed, 3 insertions, 4 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 } } diff --git a/library/std/src/sys/alloc/windows/tests.rs b/library/std/src/sys/alloc/windows/tests.rs index 674a3e1d92d..1d5614528b1 100644 --- a/library/std/src/sys/alloc/windows/tests.rs +++ b/library/std/src/sys/alloc/windows/tests.rs @@ -1,9 +1,8 @@ use super::{Header, MIN_ALIGN}; -use crate::mem; #[test] fn alloc_header() { // Header must fit in the padding before an aligned pointer - assert!(mem::size_of::<Header>() <= MIN_ALIGN); - assert!(mem::align_of::<Header>() <= MIN_ALIGN); + assert!(size_of::<Header>() <= MIN_ALIGN); + assert!(align_of::<Header>() <= MIN_ALIGN); } |
