1 // Tests that it is possible to create a global allocator in a submodule, rather than in the crate
4 #![feature(alloc, allocator_api, global_allocator)]
9 alloc::{GlobalAlloc, Layout},
15 unsafe impl GlobalAlloc for MyAlloc {
16 unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
20 unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {}
27 static MY_HEAP: MyAlloc = MyAlloc; //~ ERROR global_allocator