Use constant instead of removed const_in_array_repeat_expressions feature

This commit is contained in:
Philipp Oppermann
2021-02-02 11:32:18 +01:00
parent 380e54d6b8
commit 63be7cda6b
2 changed files with 2 additions and 2 deletions

View File

@@ -31,8 +31,9 @@ pub struct FixedSizeBlockAllocator {
impl FixedSizeBlockAllocator { impl FixedSizeBlockAllocator {
/// Creates an empty FixedSizeBlockAllocator. /// Creates an empty FixedSizeBlockAllocator.
pub const fn new() -> Self { pub const fn new() -> Self {
const EMPTY: Option<&'static mut ListNode> = None;
FixedSizeBlockAllocator { FixedSizeBlockAllocator {
list_heads: [None; BLOCK_SIZES.len()], list_heads: [EMPTY; BLOCK_SIZES.len()],
fallback_allocator: linked_list_allocator::Heap::empty(), fallback_allocator: linked_list_allocator::Heap::empty(),
} }
} }

View File

@@ -4,7 +4,6 @@
#![feature(abi_x86_interrupt)] #![feature(abi_x86_interrupt)]
#![feature(alloc_error_handler)] #![feature(alloc_error_handler)]
#![feature(const_mut_refs)] #![feature(const_mut_refs)]
#![feature(const_in_array_repeat_expressions)]
#![test_runner(crate::test_runner)] #![test_runner(crate::test_runner)]
#![reexport_test_harness_main = "test_main"] #![reexport_test_harness_main = "test_main"]