From 2f6d416c213c2900c86479564f21523522f92b7d Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 24 Jul 2024 10:49:46 +0800 Subject: [PATCH] change const_fn feature --- experiments/src/main.rs | 1 - libcortex_a9/src/lib.rs | 2 +- libcortex_a9/src/sync_channel.rs | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/experiments/src/main.rs b/experiments/src/main.rs index cf86587..89d2c7c 100644 --- a/experiments/src/main.rs +++ b/experiments/src/main.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(const_in_array_repeat_expressions)] #![feature(naked_functions)] #![feature(asm)] diff --git a/libcortex_a9/src/lib.rs b/libcortex_a9/src/lib.rs index 2f341d3..03633f8 100644 --- a/libcortex_a9/src/lib.rs +++ b/libcortex_a9/src/lib.rs @@ -1,7 +1,7 @@ #![no_std] #![feature(llvm_asm, global_asm)] #![feature(never_type)] -#![feature(const_fn)] +#![feature(const_fn_trait_bound)] extern crate alloc; diff --git a/libcortex_a9/src/sync_channel.rs b/libcortex_a9/src/sync_channel.rs index e21df16..a672f6e 100644 --- a/libcortex_a9/src/sync_channel.rs +++ b/libcortex_a9/src/sync_channel.rs @@ -178,7 +178,8 @@ macro_rules! sync_channel { { use core::sync::atomic::{AtomicUsize, AtomicPtr}; use $crate::sync_channel::{Sender, Receiver}; - static LIST: [AtomicPtr<$t>; $cap + 1] = [AtomicPtr::new(core::ptr::null_mut()); $cap + 1]; + const cnst_ptr: AtomicPtr<$t> = AtomicPtr::new(core::ptr::null_mut()); + static LIST: [AtomicPtr<$t>; $cap + 1] = [cnst_ptr; $cap + 1]; static WRITE: AtomicUsize = AtomicUsize::new(0); static READ: AtomicUsize = AtomicUsize::new(0); (Sender::new(&LIST, &WRITE, &READ), Receiver::new(&LIST, &WRITE, &READ))