From de411d046cca77cae529bdd28bfdb70e75188c55 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Thu, 5 Mar 2020 20:55:06 +0100 Subject: [PATCH] Fix build on nightly 1.43.0 (05-03-2020). The AllocRef trait has been changed slightly. See https://doc.rust-lang.org/nightly/std/alloc/trait.AllocRef.html#tymethod.alloc --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dbccde9..7b2177a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -130,8 +130,8 @@ impl Heap { } unsafe impl AllocRef for Heap { - unsafe fn alloc(&mut self, layout: Layout) -> Result, AllocErr> { - self.allocate_first_fit(layout) + unsafe fn alloc(&mut self, layout: Layout) -> Result<(NonNull, usize), AllocErr> { + Ok((self.allocate_first_fit(layout)?, layout.size())) } unsafe fn dealloc(&mut self, ptr: NonNull, layout: Layout) {