Skip to content

Commit

Permalink
fix unused-import error on android
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 3, 2019
1 parent 45e7ba9 commit 2e47fc3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libstd/sys/unix/alloc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::ptr;
use crate::sys_common::alloc::{MIN_ALIGN, realloc_fallback};
use crate::alloc::{GlobalAlloc, Layout, System};
use crate::mem;

#[stable(feature = "alloc_system_type", since = "1.28.0")]
unsafe impl GlobalAlloc for System {
Expand Down Expand Up @@ -88,7 +87,7 @@ unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
let mut out = ptr::null_mut();
// posix_memalign requires 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(mem::size_of::<usize>());
let align = layout.align().max(crate::mem::size_of::<usize>());
let ret = libc::posix_memalign(&mut out, align, layout.size());
if ret != 0 {
ptr::null_mut()
Expand Down

0 comments on commit 2e47fc3

Please sign in to comment.