Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/.cspell/project-dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
addi
amocas
amoswap
amswap
Expand Down Expand Up @@ -38,13 +37,11 @@ isync
kuser
LAAL
lclang
ldapr
ldar
ldarx
ldaxp
ldclrp
ldiapp
ldrd
ldrex
ldrexd
ldsetp
Expand All @@ -70,12 +67,9 @@ memw
mfcr
mfence
mgba
movd
movi
movlps
movq
movsd
movss
mspdebug
msync
muldi
Expand All @@ -84,7 +78,6 @@ nostartfiles
opensbi
orrs
partword
pshufd
pstq
qbsp
quadword
Expand All @@ -99,13 +92,11 @@ SCWP
SCWPE
seqz
sete
shufps
signedness
simavr
simio
slli
sllv
sltui
srai
sreg
srlv
Expand All @@ -115,7 +106,6 @@ stilp
stlxp
stpq
stqcx
strd
strex
strexd
stwcx
Expand All @@ -136,7 +126,6 @@ xadd
xchg
xmegau
xmmword
xorps
zaamo
zabha
zacas
Expand Down
55 changes: 9 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ jobs:
include:
# ------------------------------------------------------------
# x86_64-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: x86_64-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: x86_64-unknown-linux-gnu
# - rust: '1.81' # LLVM 18
Expand Down Expand Up @@ -89,9 +87,6 @@ jobs:
os: windows-latest
# ------------------------------------------------------------
# aarch64-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
Expand Down Expand Up @@ -120,9 +115,6 @@ jobs:
# flags: -Z codegen-backend=cranelift
# ------------------------------------------------------------
# aarch64-apple-darwin
- rust: '1.59' # LLVM 13
target: aarch64-apple-darwin
os: macos-latest
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: aarch64-apple-darwin
os: macos-latest
Expand All @@ -148,8 +140,6 @@ jobs:
os: windows-11-arm
# ------------------------------------------------------------
# aarch64_be-unknown-linux-gnu
- rust: nightly-2021-12-16 # Rust 1.59, LLVM 13 (oldest version we can use stable asm on this target)
target: aarch64_be-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: aarch64_be-unknown-linux-gnu
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
Expand All @@ -175,8 +165,6 @@ jobs:
os: windows-11-arm
# ------------------------------------------------------------
# armv5te-unknown-linux-gnueabi
- rust: '1.59' # LLVM 13
target: armv5te-unknown-linux-gnueabi
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: armv5te-unknown-linux-gnueabi
# - rust: '1.81' # LLVM 18
Expand All @@ -191,8 +179,6 @@ jobs:
target: armv5te-unknown-linux-gnueabi
# ------------------------------------------------------------
# arm-unknown-linux-gnueabi
- rust: '1.59' # LLVM 13
target: arm-unknown-linux-gnueabi
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: arm-unknown-linux-gnueabi
# - rust: '1.81' # LLVM 18
Expand All @@ -208,8 +194,6 @@ jobs:
target: arm-unknown-linux-gnueabi
# ------------------------------------------------------------
# armv7-unknown-linux-gnueabi
- rust: '1.59' # LLVM 13
target: armv7-unknown-linux-gnueabi
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: armv7-unknown-linux-gnueabi
# - rust: '1.81' # LLVM 18
Expand All @@ -225,9 +209,6 @@ jobs:
target: armv7-unknown-linux-gnueabi
# ------------------------------------------------------------
# armv7-unknown-linux-gnueabihf
- rust: '1.59' # LLVM 13
target: armv7-unknown-linux-gnueabihf
os: ubuntu-24.04-arm
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: armv7-unknown-linux-gnueabihf
os: ubuntu-24.04-arm
Expand All @@ -251,9 +232,6 @@ jobs:
os: ubuntu-latest # QEMU on x86_64
# ------------------------------------------------------------
# armeb-unknown-linux-gnueabi
- rust: nightly-2022-09-16 # Rust 1.65, LLVM 15 (version that this target was added)
target: armeb-unknown-linux-gnueabi
os: ubuntu-22.04
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: armeb-unknown-linux-gnueabi
os: ubuntu-22.04
Expand All @@ -268,8 +246,6 @@ jobs:
os: ubuntu-22.04
# ------------------------------------------------------------
# i586-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: i586-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: i586-unknown-linux-gnu
# - rust: '1.81' # LLVM 18
Expand All @@ -284,8 +260,6 @@ jobs:
target: i586-unknown-linux-gnu
# ------------------------------------------------------------
# i686-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: i686-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: i686-unknown-linux-gnu
# - rust: '1.81' # LLVM 18
Expand All @@ -306,8 +280,6 @@ jobs:
target: hexagon-unknown-linux-musl
# ------------------------------------------------------------
# loongarch64-unknown-linux-gnu
- rust: '1.72' # LLVM 16 (inline asm for loongarch64 has been stabilized in Rust 1.72)
target: loongarch64-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: loongarch64-unknown-linux-gnu
# - rust: '1.81' # LLVM 18
Expand All @@ -323,7 +295,7 @@ jobs:
target: loongarch64-unknown-linux-gnu
# ------------------------------------------------------------
# mips-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: mips-unknown-linux-gnu
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# target: mips-unknown-linux-gnu
Expand All @@ -333,7 +305,7 @@ jobs:
target: mips-unknown-linux-gnu
# ------------------------------------------------------------
# mipsel-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: mipsel-unknown-linux-gnu
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# target: mipsel-unknown-linux-gnu
Expand All @@ -343,7 +315,7 @@ jobs:
target: mipsel-unknown-linux-gnu
# ------------------------------------------------------------
# mips64-unknown-linux-gnuabi64
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: mips64-unknown-linux-gnuabi64
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# target: mips64-unknown-linux-gnuabi64
Expand All @@ -353,7 +325,7 @@ jobs:
target: mips64-unknown-linux-gnuabi64
# ------------------------------------------------------------
# mips64el-unknown-linux-gnuabi64
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: mips64el-unknown-linux-gnuabi64
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# target: mips64el-unknown-linux-gnuabi64
Expand Down Expand Up @@ -403,7 +375,7 @@ jobs:
target: mipsisa64r6el-unknown-linux-gnuabi64
# ------------------------------------------------------------
# powerpc-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: powerpc-unknown-linux-gnu
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# target: powerpc-unknown-linux-gnu
Expand All @@ -413,7 +385,7 @@ jobs:
target: powerpc-unknown-linux-gnu
# ------------------------------------------------------------
# powerpc64-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: powerpc64-unknown-linux-gnu
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# target: powerpc64-unknown-linux-gnu
Expand All @@ -423,7 +395,7 @@ jobs:
target: powerpc64-unknown-linux-gnu
# ------------------------------------------------------------
# powerpc64le-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: powerpc64le-unknown-linux-gnu
# - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# target: powerpc64le-unknown-linux-gnu
Expand All @@ -443,8 +415,6 @@ jobs:
target: riscv32gc-unknown-linux-gnu
# ------------------------------------------------------------
# riscv64gc-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: riscv64gc-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: riscv64gc-unknown-linux-gnu
# - rust: '1.81' # LLVM 18
Expand Down Expand Up @@ -483,9 +453,6 @@ jobs:
target: sparc64-unknown-linux-gnu
# ------------------------------------------------------------
# thumbv7neon-unknown-linux-gnueabihf
- rust: '1.59' # LLVM 13
target: thumbv7neon-unknown-linux-gnueabihf
os: ubuntu-24.04-arm
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: thumbv7neon-unknown-linux-gnueabihf
os: ubuntu-24.04-arm
Expand Down Expand Up @@ -676,8 +643,6 @@ jobs:

- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-} --direct
# -Z direct-minimal-versions requires Cargo 1.70.
if: (!(startsWith(matrix.rust, '1.5') || startsWith(matrix.rust, '1.6') || startsWith(matrix.rust, 'nightly-2021') || startsWith(matrix.rust, 'nightly-2022') || startsWith(matrix.rust, 'nightly-2023')))

build:
needs: tidy
Expand All @@ -686,12 +651,10 @@ jobs:
fail-fast: false
matrix:
include:
- rust: '1.59'
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
- rust: stable
- rust: beta
- rust: nightly-2023-08-23 # The last nightly version that doesn't support MaybeUninit registers.
- rust: nightly-2023-08-24 # The oldest nightly version that supports MaybeUninit registers: https://github.com/rust-lang/rust/pull/114790
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
- rust: nightly
# Check that test suite can be built
- name: nightly, --tests
Expand All @@ -715,7 +678,7 @@ jobs:
fail-fast: false
matrix:
rust:
- '1.64' # LLVM 14
- '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
- stable
# - beta
- nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com

## [Unreleased]

- Increase the minimum supported Rust version (MSRV) from Rust 1.59 to Rust 1.74.

- Remove `AtomicMaybeUninit::const_new` because `AtomicMaybeUninit::new` is now always `const fn` because of the MSRV bump.

- Remove legacy [inefficient](https://github.com/crossbeam-rs/crossbeam/pull/1015#issuecomment-1676549870) implementation for pre-1.74 Rust which doesn't support `MaybeUninit` registers in `asm!`.

## [0.3.9] - 2025-09-05

- Update to stabilized [LoongArch32](https://github.com/rust-lang/rust/pull/144402) inline assembly. ([803b062](https://github.com/taiki-e/atomic-maybe-uninit/commit/803b06263c8a3e38596eb48aec88d2dce77d60e6))
Expand Down
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "atomic-maybe-uninit"
version = "0.3.9" #publish:version
edition = "2021"
rust-version = "1.59" # For asm!
rust-version = "1.74" # For MaybeUninit registers in asm!: https://github.com/rust-lang/rust/pull/114790
license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/atomic-maybe-uninit"
keywords = ["atomic"]
Expand Down Expand Up @@ -30,14 +30,13 @@ allowed_external_types = [
doc-scrape-examples = false

[dev-dependencies]
build-context = "0.1"
crossbeam-utils = { version = "0.8", git = "https://github.com/crossbeam-rs/crossbeam.git", rev = "17fb841" } # The latest released crossbeam-utils requires Rust 1.60
crossbeam-utils = "0.8"
fastrand = "2"
paste = "1"
quickcheck = { version = "1", default-features = false, git = "https://github.com/taiki-e/quickcheck.git", rev = "83b1d59" } # https://github.com/BurntSushi/quickcheck/pull/304 + https://github.com/BurntSushi/quickcheck/pull/282 + https://github.com/BurntSushi/quickcheck/pull/296 + f16/f128 support + lower MSRV

[target.'cfg(unix)'.dev-dependencies]
libc = "=0.2.163" # newer libc requires Rust 1.63
libc = "0.2"

[lints]
workspace = true
Expand Down Expand Up @@ -96,7 +95,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
] }
unnameable_types = "warn"
unreachable_pub = "warn"
# unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 merged in Rust 1.65 is not available on MSRV
unsafe_op_in_unsafe_fn = "warn"
[workspace.lints.clippy]
all = "warn" # Downgrade deny-by-default lints
pedantic = "warn"
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![crates.io](https://img.shields.io/crates/v/atomic-maybe-uninit?style=flat-square&logo=rust)](https://crates.io/crates/atomic-maybe-uninit)
[![docs.rs](https://img.shields.io/badge/docs.rs-atomic--maybe--uninit-blue?style=flat-square&logo=docs.rs)](https://docs.rs/atomic-maybe-uninit)
[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license)
[![msrv](https://img.shields.io/badge/msrv-1.59-blue?style=flat-square&logo=rust)](https://www.rust-lang.org)
[![msrv](https://img.shields.io/badge/msrv-1.74-blue?style=flat-square&logo=rust)](https://www.rust-lang.org)
[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/atomic-maybe-uninit/ci.yml?branch=main&style=flat-square&logo=github)](https://github.com/taiki-e/atomic-maybe-uninit/actions)

<!-- tidy:sync-markdown-to-rustdoc:start:src/lib.rs -->
Expand Down Expand Up @@ -32,10 +32,10 @@ Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch, Arm64EC, s390x, MIPS, P
| riscv32 (+zacas) \[4] | i64,u64 | ✓ | ✓ |
| riscv64 | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 | ✓ | ✓\[1] |
| riscv64 (+zacas) \[4] | i128,u128 | ✓ | ✓ |
| loongarch64 \[7] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 | ✓ | ✓ |
| loongarch32 \[10] (experimental) | isize,usize,i8,u8,i16,u16,i32,u32 | ✓ | ✓ |
| arm64ec \[8] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 | ✓ | ✓ |
| s390x \[8] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 | ✓ | ✓ |
| loongarch64 | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 | ✓ | ✓ |
| loongarch32 \[8] (experimental) | isize,usize,i8,u8,i16,u16,i32,u32 | ✓ | ✓ |
| arm64ec \[7] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 | ✓ | ✓ |
| s390x \[7] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 | ✓ | ✓ |
| mips / mips32r6 \[9] | isize,usize,i8,u8,i16,u16,i32,u32 | ✓ | ✓ |
| mips64 / mips64r6 \[9] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 | ✓ | ✓ |
| powerpc \[9] | isize,usize,i8,u8,i16,u16,i32,u32 | ✓ | ✓ |
Expand All @@ -55,9 +55,8 @@ Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch, Arm64EC, s390x, MIPS, P
\[4] Requires `zacas` target feature.<br>
\[5] Requires `quadword-atomics` target feature (enabled by default on powerpc64le).<br>
\[6] Requires `v9` or `leoncasa` target feature (enabled by default on Linux).<br>
\[7] Requires Rust 1.72+.<br>
\[8] Requires Rust 1.84+.<br>
\[10] Requires Rust 1.91+.<br>
\[7] Requires Rust 1.84+.<br>
\[8] Requires Rust 1.91+.<br>
\[9] Requires nightly due to `#![feature(asm_experimental_arch)]`.<br>

See also [Atomic operation overview by architecture](https://github.com/taiki-e/atomic-maybe-uninit/blob/HEAD/src/arch/README.md) for more information about atomic operations in these architectures.
Expand Down
Loading
Loading