From e3534028ebcd34b131228a05c1787ad8895209ec Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 18 Jun 2018 21:11:59 -0500 Subject: [PATCH] fix test --- src/test/ui/allocator-submodule.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/ui/allocator-submodule.rs b/src/test/ui/allocator-submodule.rs index 40e5940c558d..39b65766924f 100644 --- a/src/test/ui/allocator-submodule.rs +++ b/src/test/ui/allocator-submodule.rs @@ -15,16 +15,19 @@ extern crate alloc; -use std::alloc::{GlobalAlloc, Layout, Opaque}; +use std::{ + alloc::{GlobalAlloc, Layout}, + ptr, +}; struct MyAlloc; unsafe impl GlobalAlloc for MyAlloc { - unsafe fn alloc(&self, layout: Layout) -> *mut Opaque { - 0 as usize as *mut Opaque + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + ptr::null_mut() } - unsafe fn dealloc(&self, ptr: *mut Opaque, layout: Layout) {} + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {} } mod submod {