diff --git a/src/memory/heap_allocator.rs b/src/memory/heap_allocator.rs index 0a232f92..cf8e6d20 100644 --- a/src/memory/heap_allocator.rs +++ b/src/memory/heap_allocator.rs @@ -41,6 +41,10 @@ unsafe impl<'a> Alloc for &'a BumpAllocator { unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout) { // do nothing, leak memory } + + fn oom(&mut self, _: AllocErr) -> ! { + panic!("Out of memory"); + } } /// Align downwards. Returns the greatest x with alignment `align`