Skip to content

Commit f63cb88

Browse files
authored
Fix build on nightly 1.43.0 (05-03-2020). (#25)
The AllocRef trait has been changed slightly. See https://doc.rust-lang.org/nightly/std/alloc/trait.AllocRef.html#tymethod.alloc
1 parent 01a2511 commit f63cb88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ impl Heap {
130130
}
131131

132132
unsafe impl AllocRef for Heap {
133-
unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
134-
self.allocate_first_fit(layout)
133+
unsafe fn alloc(&mut self, layout: Layout) -> Result<(NonNull<u8>, usize), AllocErr> {
134+
Ok((self.allocate_first_fit(layout)?, layout.size()))
135135
}
136136

137137
unsafe fn dealloc(&mut self, ptr: NonNull<u8>, layout: Layout) {

0 commit comments

Comments
 (0)