Skip to content

Commit

Permalink
Fixed loom compile issues, and bumped msrv
Browse files Browse the repository at this point in the history
Now MSRV is 1.61.0 due to the use of const fns
  • Loading branch information
Amjad50 committed Feb 22, 2024
1 parent 73d1a35 commit 19d920b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
matrix:
msrv: ["1.60.0"]
msrv: ["1.61.0"]
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Fast, bounded, multiple-producer, multiple-consumer, lossy, broad
repository = "https://github.com/Amjad50/blinkcast.git"
keywords = ["channel", "broadcast", "mpmc", "no_std"]
categories = ["concurrency", "no-std"]
rust-version = "1.60.0"
rust-version = "1.61.0"

[features]
default = ["alloc"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ up to date is better than delayed audio.
See [the documentation](https://docs.rs/blinkcast) for examples.

# Minimum Supported Rust Version (MSRV)
The minimum supported Rust version for this crate is `1.60.0`
The minimum supported Rust version for this crate is `1.61.0`

# License
Licensed under `MIT` ([LICENSE](./LICENSE) or http://opensource.org/licenses/MIT)
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ mod tests;
#[cfg(feature = "alloc")]
pub mod alloc;
mod core_impl;
#[cfg(not(loom))]
// Atomics in `loom` don't support `const fn`, so it crashes when compiling
// since, we don't need `static_mem` to be tested with `loom`, we can just
// exclude it if we are building for `loom`
pub mod static_mem;

// choose 64 for targets that support it, otherwise 32
Expand Down Expand Up @@ -154,6 +158,10 @@ struct Node<T> {
}

impl<T> Node<T> {
#[cfg(not(loom))]
// Atomics in `loom` don't support `const fn`, so it crashes when compiling
// since, we don't need `static_mem` to be tested with `loom`, we can just
// exclude it if we are building for `loom`
pub const fn empty() -> Self {
Self {
data: UnsafeCell::new(MaybeUninit::uninit()),
Expand Down

0 comments on commit 19d920b

Please sign in to comment.