From 0c96981fd2cf495eba7bb19528efb8297ac314c4 Mon Sep 17 00:00:00 2001 From: Zac Harrold Date: Tue, 18 Aug 2026 13:20:31 +1000 Subject: [PATCH] wgpu-sync: remove `alloc` feature The project is otherwise not `no_alloc` compatible, and is capable of making a breaking change in the future if desirable. Co-Authored-By: Kevin Reid --- .github/workflows/ci.yml | 2 +- wgpu-sync/Cargo.toml | 5 ++--- wgpu-sync/src/lib.rs | 5 +---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 153750a8f..de9159512 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -333,7 +333,7 @@ jobs: # Check with all compatible features cargo --locked clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-types --no-default-features --features strict_asserts,fragile-send-sync-non-atomic-wasm,serde,counters cargo --locked clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p naga-types --no-default-features --features serialize,deserialize - cargo --locked clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-sync --no-default-features --features alloc + cargo --locked clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-sync --no-default-features cargo --locked clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p naga --no-default-features --features dot-out,spv-in,spv-out,glsl-out,msl-out,serialize,deserialize,wgsl-in,wgsl-out,hlsl-out cargo --locked clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-hal --no-default-features --features fragile-send-sync-non-atomic-wasm cargo --locked clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} -p wgpu-core --no-default-features --features api_log_info,resource_log_info,strict_asserts,serde,wgsl,spirv,counters,noop diff --git a/wgpu-sync/Cargo.toml b/wgpu-sync/Cargo.toml index 7ab4d2f52..6738e6f3f 100644 --- a/wgpu-sync/Cargo.toml +++ b/wgpu-sync/Cargo.toml @@ -29,11 +29,10 @@ alloc_instead_of_core = "warn" [features] default = ["std"] -std = ["alloc", "dep:parking_lot", "once_cell/std"] -alloc = ["once_cell/alloc"] +std = ["dep:parking_lot", "once_cell/std"] [dependencies] cfg-if.workspace = true lock_api = { workspace = true, default-features = false } parking_lot = { workspace = true, optional = true } -once_cell = { workspace = true, default-features = false, features = ["race"] } +once_cell = { workspace = true, default-features = false, features = ["alloc", "race"] } diff --git a/wgpu-sync/src/lib.rs b/wgpu-sync/src/lib.rs index 79084747e..b0b6f1dfe 100644 --- a/wgpu-sync/src/lib.rs +++ b/wgpu-sync/src/lib.rs @@ -9,7 +9,6 @@ //! Provides [`Mutex`] and [`RwLock`] types with an appropriate implementation. -#[cfg(feature = "alloc")] extern crate alloc; #[cfg(feature = "std")] extern crate std; @@ -26,9 +25,7 @@ pub use rwlock::RawRwLock; #[cfg(feature = "std")] pub use parking_lot::{Condvar, Mutex as CondvarMutex}; -#[cfg(feature = "alloc")] -pub use once_cell::race::OnceBox; -pub use once_cell::race::{OnceBool, OnceNonZeroUsize, OnceRef}; +pub use once_cell::race::{OnceBool, OnceBox, OnceNonZeroUsize, OnceRef}; cfg_if::cfg_if! { if #[cfg(feature = "std")] {