diff --git a/kernel/heap/src/lib.rs b/kernel/heap/src/lib.rs index d5e9700d1c..9d93a8336a 100644 --- a/kernel/heap/src/lib.rs +++ b/kernel/heap/src/lib.rs @@ -89,7 +89,7 @@ unsafe impl GlobalAlloc for Heap { } unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { - if (ptr as usize) < INITIAL_HEAP_END_ADDR { + if KERNEL_HEAP_START <= (ptr as usize) && (ptr as usize) < INITIAL_HEAP_END_ADDR { self.initial_allocator.lock().deallocate(ptr, layout); } else { diff --git a/kernel/panic_entry/src/lib.rs b/kernel/panic_entry/src/lib.rs index 95dee82617..68a6416703 100644 --- a/kernel/panic_entry/src/lib.rs +++ b/kernel/panic_entry/src/lib.rs @@ -6,6 +6,7 @@ #![no_std] #![feature(alloc_error_handler)] +#![allow(internal_features)] #![feature(lang_items)] #![feature(panic_info_message)] diff --git a/kernel/thread_local_macro/src/lib.rs b/kernel/thread_local_macro/src/lib.rs index 91c03acc49..76ab879a0d 100644 --- a/kernel/thread_local_macro/src/lib.rs +++ b/kernel/thread_local_macro/src/lib.rs @@ -29,6 +29,7 @@ #![no_std] #![feature(thread_local)] +#![allow(internal_features)] #![feature(allow_internal_unstable)] // The code from Rust std uses unsafe blocks within unsafe functions,