diff options
| author | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-22 20:16:13 -0700 |
|---|---|---|
| committer | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-22 20:16:13 -0700 |
| commit | 985dff9e7ed1fd7896b071eaf637fd531a690e91 (patch) | |
| tree | b7a2e74b0070d106dd392801bd84a267f69aa9f0 | |
| parent | 14736ca20b2e5f60981743c6ee2dfa62db818767 (diff) | |
| download | rust-985dff9e7ed1fd7896b071eaf637fd531a690e91.tar.gz rust-985dff9e7ed1fd7896b071eaf637fd531a690e91.zip | |
fixing the test failure
| -rw-r--r-- | src/test/ui/allocator/custom.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ extern crate helper; 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 impl alloc::GlobalAlloc for A { 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) } } |
