From 6409658967a3ea22544acaed9315057694f80267 Mon Sep 17 00:00:00 2001 From: Nekomaru-PKU Date: Tue, 4 Feb 2025 23:36:01 -0500 Subject: [PATCH] Fix #83 elsa 1.11.0 fails to compile in older Rust toolchain due to usage of the inline-const feature --- Cargo.toml | 2 +- src/sync.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3465147..937ae57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "elsa" -version = "1.11.0" +version = "1.11.1" authors = ["Manish Goregaokar "] edition = "2018" description = "Append-only collections for Rust where borrows to entries can outlive insertions" diff --git a/src/sync.rs b/src/sync.rs index 2cdd367..bc8a9df 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -712,8 +712,10 @@ impl Default for LockFreeFrozenVec { } impl LockFreeFrozenVec { + const NULL_ATOMIC_PTR: AtomicPtr = AtomicPtr::new(std::ptr::null_mut()); + const fn null() -> [AtomicPtr; NUM_BUFFERS] { - [const { AtomicPtr::new(std::ptr::null_mut()) }; NUM_BUFFERS] + [Self::NULL_ATOMIC_PTR; NUM_BUFFERS] } pub const fn new() -> Self {