Closed berkus closed 3 years ago
You use use core::alloc::AllocRef;
which is not available in the latest nightly anymore. Replace it with use core::alloc::Allocator
and call it with dma.allocate_zeroed
. The trait and the methods just got renamed recently.
Yes, that's what I'm saying - I renamed it to Allocator (I just wrote that in the second sentence!) and it started to fail compilation.
error[E0599]: no method named `alloc_zeroed` found for mutable reference `&mut BumpAllocator` in the current scope
--> nucleus/src/platform/rpi3/mailbox.rs:364:21
|
364 | dma.alloc_zeroed(
| ^^^^^^^^^^^^ method not found in `&mut BumpAllocator`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `alloc_zeroed`, perhaps you need to implement it:
candidate #1: `GlobalAlloc`
I can't have GlobalAlloc because I'm in no_std no_main no_alloc land!
How do I reopen that, do I need to file a new ticket?
Even if i import the GlobalAlloc trait it's definitely not implemented anywhere, so there's no implementation of alloc_zeroed available.
error: unused import: `core::alloc::GlobalAlloc`
--> nucleus/src/platform/rpi3/mailbox.rs:361:13
|
361 | use core::alloc::GlobalAlloc;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
The method has been renamed to allocate_zeroed
.
Thank you @Amanieu !
Unfortunately I couldn't find any mention of that in the tickets.
Replace it with use core::alloc::Allocator and call it with dma.allocate_zeroed. The trait and the methods just got renamed recently.
@TimDiekmann yeah, I'm dumb and can't read apparently, sorry about that.
It all compiled now, I can develop aarch64-unknown-none-softfloat
from aarch64-apple-darwin
now, hurray!
No problem, nice to hear everything works now! :slightly_smiling_face:
I used to have this code which uses alloc_zeroed previously in AllocRef (implemented via this).
I've updated to the new alllocator interface (AllocRef -> Allocator), but now it fails to build and I'm not sure how can I replace it, because I don't have a GlobalAllocator and don't want to implement it for my BumpAllocator class.
Any advice?