From 63be7cda6be074b42815b411b1ccc7e0bb6f0a66 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 2 Feb 2021 11:32:18 +0100 Subject: [PATCH] Use constant instead of removed `const_in_array_repeat_expressions` feature --- src/allocator/fixed_size_block.rs | 3 ++- src/lib.rs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/allocator/fixed_size_block.rs b/src/allocator/fixed_size_block.rs index 559199ce..fa3985a0 100644 --- a/src/allocator/fixed_size_block.rs +++ b/src/allocator/fixed_size_block.rs @@ -31,8 +31,9 @@ pub struct FixedSizeBlockAllocator { impl FixedSizeBlockAllocator { /// Creates an empty FixedSizeBlockAllocator. pub const fn new() -> Self { + const EMPTY: Option<&'static mut ListNode> = None; FixedSizeBlockAllocator { - list_heads: [None; BLOCK_SIZES.len()], + list_heads: [EMPTY; BLOCK_SIZES.len()], fallback_allocator: linked_list_allocator::Heap::empty(), } } diff --git a/src/lib.rs b/src/lib.rs index ee11eced..194f4b86 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ #![feature(abi_x86_interrupt)] #![feature(alloc_error_handler)] #![feature(const_mut_refs)] -#![feature(const_in_array_repeat_expressions)] #![test_runner(crate::test_runner)] #![reexport_test_harness_main = "test_main"]