From 985dff9e7ed1fd7896b071eaf637fd531a690e91 Mon Sep 17 00:00:00 2001 From: blitzerr Date: Tue, 22 Sep 2020 20:16:13 -0700 Subject: [PATCH] fixing the test failure --- src/test/ui/allocator/custom.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/ui/allocator/custom.rs b/src/test/ui/allocator/custom.rs index f54ef1f0bc1..73750bf139a 100644 --- a/src/test/ui/allocator/custom.rs +++ b/src/test/ui/allocator/custom.rs @@ -10,6 +10,7 @@ use std::alloc::{self, AllocRef, Global, Layout, System}; use std::sync::atomic::{AtomicUsize, Ordering}; +use std::ptr::NonNull; static HITS: AtomicUsize = AtomicUsize::new(0); @@ -23,7 +24,7 @@ unsafe fn alloc(&self, layout: Layout) -> *mut u8 { unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { HITS.fetch_add(1, Ordering::SeqCst); - AllocRef::dealloc(&System, ptr, layout) + AllocRef::dealloc(&System, NonNull::new(ptr).unwrap(), layout) } } -- 2.44.0