bump rustc, llvm #119

Merged
sb10q merged 11 commits from srenblad/zynq-rs:bump_to_llvm13 into master 2024-12-20 14:06:38 +08:00
3 changed files with 8 additions and 4 deletions
Showing only changes of commit 0ea7e2c760 - Show all commits

View File

@ -1,7 +1,8 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
#![feature(const_in_array_repeat_expressions)]
#![feature(naked_functions)] #![feature(naked_functions)]
#![feature(asm)]
#![feature(inline_const)]
extern crate alloc; extern crate alloc;

View File

@ -1,8 +1,9 @@
#![no_std] #![no_std]
#![feature(never_type)] #![feature(never_type)]
#![feature(const_fn)]
#![feature(global_asm)] #![feature(global_asm)]
#![feature(asm)] #![feature(asm)]
#![feature(inline_const)]
#![feature(const_fn_trait_bound)]
extern crate alloc; extern crate alloc;

View File

@ -172,13 +172,15 @@ impl<'a, T> Iterator for Receiver<'a, T> where T: Clone {
#[macro_export] #[macro_export]
/// Macro for initializing the sync_channel with static buffer and indexes. /// Macro for initializing the sync_channel with static buffer and indexes.
/// Note that this requires `#![feature(const_in_array_repeat_expressions)]`
macro_rules! sync_channel { macro_rules! sync_channel {
($t: ty, $cap: expr) => { ($t: ty, $cap: expr) => {
{ {
use core::sync::atomic::{AtomicUsize, AtomicPtr}; use core::sync::atomic::{AtomicUsize, AtomicPtr};
use $crate::sync_channel::{Sender, Receiver}; use $crate::sync_channel::{Sender, Receiver};
static LIST: [AtomicPtr<$t>; $cap + 1] = [AtomicPtr::new(core::ptr::null_mut()); $cap + 1]; const fn new_atomic() -> AtomicPtr<$t> {
AtomicPtr::new(core::ptr::null_mut())
}
static LIST: [AtomicPtr<$t>; $cap + 1] = [const { new_atomic() }; $cap + 1];
static WRITE: AtomicUsize = AtomicUsize::new(0); static WRITE: AtomicUsize = AtomicUsize::new(0);
static READ: AtomicUsize = AtomicUsize::new(0); static READ: AtomicUsize = AtomicUsize::new(0);
(Sender::new(&LIST, &WRITE, &READ), Receiver::new(&LIST, &WRITE, &READ)) (Sender::new(&LIST, &WRITE, &READ), Receiver::new(&LIST, &WRITE, &READ))