You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling alloc-cortex-m v0.4.0 (/home/jacob/git/alloc-cortex-m)
Error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
--> src/lib.rs:29:43
|
29 | heap: Mutex::new(RefCell::new(Heap::empty())),
| ^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0015`.
error: could not compile `alloc-cortex-m`
This fixes the error, but I'm not sure if this follows the original intent:
diff --git a/src/lib.rs b/src/lib.rs
index 56d2305..338aa0a 100644
--- a/src/lib.rs+++ b/src/lib.rs@@ -24,7 +24,7 @@ impl CortexMHeap {
///
/// You must initialize this heap using the
/// [`init`](struct.CortexMHeap.html#method.init) method before using the allocator.
- pub const fn empty() -> CortexMHeap {+ pub fn empty() -> CortexMHeap {
CortexMHeap {
heap: Mutex::new(RefCell::new(Heap::empty())),
}
The text was updated successfully, but these errors were encountered:
It seems that it was caused by rust-osdev/linked-list-allocator#43, I guess we could just enable the const_mut_refs feature on the linked-list-allocator crate, since this crate is basically nightly only.
cargo build
This fixes the error, but I'm not sure if this follows the original intent:
The text was updated successfully, but these errors were encountered: