Skip to content

Commit 985dff9

Browse files
committed
fixing the test failure
1 parent 14736ca commit 985dff9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/ui/allocator/custom.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extern crate helper;
1010

1111
use std::alloc::{self, AllocRef, Global, Layout, System};
1212
use std::sync::atomic::{AtomicUsize, Ordering};
13+
use std::ptr::NonNull;
1314

1415
static HITS: AtomicUsize = AtomicUsize::new(0);
1516

@@ -23,7 +24,7 @@ unsafe impl alloc::GlobalAlloc for A {
2324

2425
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
2526
HITS.fetch_add(1, Ordering::SeqCst);
26-
AllocRef::dealloc(&System, ptr, layout)
27+
AllocRef::dealloc(&System, NonNull::new(ptr).unwrap(), layout)
2728
}
2829
}
2930

0 commit comments

Comments
 (0)