1
0
Fork 0

change const_fn feature

This commit is contained in:
Simon Renblad 2024-07-24 10:49:46 +08:00
parent 91607ea8e8
commit 2f6d416c21
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,5 @@
#![no_std]
#![no_main]
#![feature(const_in_array_repeat_expressions)]
#![feature(naked_functions)]
#![feature(asm)]

View File

@ -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;

View File

@ -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))