diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f7a3cbe2..089f5b121 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,6 +254,9 @@ jobs: cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --tests --features glsl,spirv cargo doc --target ${{ matrix.target }} ${{ matrix.extra-flags }} --no-deps --features glsl,spirv + # check with no features + cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --no-default-features + # all features cargo clippy --target ${{ matrix.target }} ${{ matrix.extra-flags }} --tests --all-features cargo doc --target ${{ matrix.target }} ${{ matrix.extra-flags }} --no-deps --all-features diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2599bd8..e75f5c3a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ By @brodycj in [#6925](https://github.com/gfx-rs/wgpu/pull/6925). ### Bug Fixes * Avoid overflow in query set bounds check validation. By @ErichDonGubler in [#????]. +* Fix `wgpu` not building with `--no-default-features` on when targeting `wasm32-unknown-unknown`. By @wumpf in [#6946](https://github.com/gfx-rs/wgpu/pull/6946). ## v24.0.0 (2025-01-15) diff --git a/wgpu/src/dispatch.rs b/wgpu/src/dispatch.rs index a58decf65..f243e51ad 100644 --- a/wgpu/src/dispatch.rs +++ b/wgpu/src/dispatch.rs @@ -636,6 +636,8 @@ macro_rules! dispatch_types_inner { Self::Core(value) => value.as_ref(), #[cfg(webgpu)] Self::WebGPU(value) => value.as_ref(), + #[cfg(not(any(wgpu_core, webgpu)))] + _ => panic!("No context available. You need to enable one of wgpu's backend feature build flags."), } } } @@ -765,6 +767,8 @@ macro_rules! dispatch_types_inner { Self::Core(value) => value, #[cfg(webgpu)] Self::WebGPU(value) => value, + #[cfg(not(any(wgpu_core, webgpu)))] + _ => panic!("No context available. You need to enable one of wgpu's backend feature build flags."), } } } @@ -777,6 +781,8 @@ macro_rules! dispatch_types_inner { Self::Core(value) => value, #[cfg(webgpu)] Self::WebGPU(value) => value, + #[cfg(not(any(wgpu_core, webgpu)))] + _ => panic!("No context available. You need to enable one of wgpu's backend feature build flags."), } } } diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index b83ae8c85..f94be6bdf 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -23,6 +23,7 @@ unsafe_op_in_unsafe_fn )] #![allow(clippy::arc_with_non_send_sync)] +#![cfg_attr(not(any(wgpu_core, webgpu)), allow(unused))] // //