diff --git a/Cargo.lock b/Cargo.lock index b2c2bb0a9..e45e12085 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2481,7 +2481,6 @@ dependencies = [ "naga", "ron", "serde", - "serde_json", "spirv", "toml", ] @@ -2497,7 +2496,6 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "strum 0.28.0", - "thiserror 2.0.21", ] [[package]] diff --git a/benches/Cargo.toml b/benches/Cargo.toml index 27735c5ee..0de873dbb 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -22,11 +22,21 @@ unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(feature, values("tracy"))', ] } +# Dependencies used by the library crate [target.'cfg(not(target_arch = "wasm32"))'.dependencies] anyhow.workspace = true +env_logger.workspace = true +pico-args.workspace = true +profiling.workspace = true +serde = { workspace = true, features = ["derive"] } +serde_json.workspace = true +termcolor.workspace = true +tracy-client = { workspace = true, optional = true } + +# Dependencies used by the benchmark crates +[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] bincode = { workspace = true, features = ["serde"] } bytemuck.workspace = true -env_logger.workspace = true naga = { workspace = true, features = [ "deserialize", "serialize", @@ -41,12 +51,6 @@ naga = { workspace = true, features = [ ] } naga-test = { workspace = true, features = [] } nanorand.workspace = true -pico-args.workspace = true pollster.workspace = true -profiling.workspace = true rayon.workspace = true -serde = { workspace = true, features = ["derive"] } -serde_json.workspace = true -termcolor.workspace = true -tracy-client = { workspace = true, optional = true } wgpu.workspace = true diff --git a/deno_webgpu/Cargo.toml b/deno_webgpu/Cargo.toml index 8f5d118ed..85198cb27 100644 --- a/deno_webgpu/Cargo.toml +++ b/deno_webgpu/Cargo.toml @@ -14,6 +14,8 @@ publish = false [lib] path = "lib.rs" +[lints] + # We make all dependencies conditional on not being wasm, # so the whole workspace can built as wasm. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/examples/bug-repro/01_texture_atomic_bug/Cargo.toml b/examples/bug-repro/01_texture_atomic_bug/Cargo.toml index 51d3413e7..f97e138d8 100644 --- a/examples/bug-repro/01_texture_atomic_bug/Cargo.toml +++ b/examples/bug-repro/01_texture_atomic_bug/Cargo.toml @@ -4,6 +4,9 @@ edition = "2021" rust-version = "1.87" publish = false +[lints] +workspace = true + [dependencies] env_logger.workspace = true pollster.workspace = true diff --git a/examples/bug-repro/02_present_bugs/Cargo.toml b/examples/bug-repro/02_present_bugs/Cargo.toml index fd8b6ce09..79fd5c1d8 100644 --- a/examples/bug-repro/02_present_bugs/Cargo.toml +++ b/examples/bug-repro/02_present_bugs/Cargo.toml @@ -4,6 +4,9 @@ edition = "2021" rust-version = "1.87" publish = false +[lints] +workspace = true + [dependencies] env_logger.workspace = true pollster.workspace = true diff --git a/examples/standalone/01_hello_compute/Cargo.toml b/examples/standalone/01_hello_compute/Cargo.toml index 04a98e78a..e695c3820 100644 --- a/examples/standalone/01_hello_compute/Cargo.toml +++ b/examples/standalone/01_hello_compute/Cargo.toml @@ -4,6 +4,8 @@ edition = "2024" rust-version = "1.87" publish = false +[lints] + [dependencies] bytemuck = { version = "1.22.0", features = ["extern_crate_alloc"] } env_logger = "0.11" diff --git a/examples/standalone/02_hello_window/Cargo.toml b/examples/standalone/02_hello_window/Cargo.toml index 48ac4b366..308a04b1c 100644 --- a/examples/standalone/02_hello_window/Cargo.toml +++ b/examples/standalone/02_hello_window/Cargo.toml @@ -4,6 +4,8 @@ edition = "2024" rust-version = "1.87" publish = false +[lints] + [dependencies] env_logger = "0.11" pollster = "1.0" diff --git a/examples/standalone/03_hdr_surface/Cargo.toml b/examples/standalone/03_hdr_surface/Cargo.toml index bd071d752..0ebc54eac 100644 --- a/examples/standalone/03_hdr_surface/Cargo.toml +++ b/examples/standalone/03_hdr_surface/Cargo.toml @@ -4,6 +4,8 @@ edition = "2024" rust-version = "1.87" publish = false +[lints] + [dependencies] wgpu = "30.0.0" winit = { version = "0.30.8", features = ["android-native-activity"] } diff --git a/examples/standalone/custom_backend/Cargo.toml b/examples/standalone/custom_backend/Cargo.toml index 24064eb54..88a103725 100644 --- a/examples/standalone/custom_backend/Cargo.toml +++ b/examples/standalone/custom_backend/Cargo.toml @@ -4,6 +4,8 @@ edition = "2024" rust-version = "1.87" publish = false +[lints] + [features] default = ["web"] web = ["wgpu/web"] diff --git a/naga-test/Cargo.toml b/naga-test/Cargo.toml index ce8bc2d62..06c934b69 100644 --- a/naga-test/Cargo.toml +++ b/naga-test/Cargo.toml @@ -31,7 +31,6 @@ spirv = { workspace = true, features = ["deserialize"] } ron.workspace = true toml.workspace = true bitflags.workspace = true -serde_json.workspace = true serde.workspace = true [lints] diff --git a/naga-types/Cargo.toml b/naga-types/Cargo.toml index 344965200..a6365c4c3 100644 --- a/naga-types/Cargo.toml +++ b/naga-types/Cargo.toml @@ -27,7 +27,6 @@ hashbrown.workspace = true indexmap.workspace = true rustc-hash.workspace = true serde = { workspace = true, features = ["alloc", "derive"], optional = true } -thiserror.workspace = true [dev-dependencies] strum.workspace = true diff --git a/naga/src/racy_lock.rs b/naga/src/racy_lock.rs index 2672ce11b..82ae781d9 100644 --- a/naga/src/racy_lock.rs +++ b/naga/src/racy_lock.rs @@ -5,6 +5,11 @@ use once_cell::race::OnceBox; #[cfg(std)] use std::sync::LazyLock; +#[cfg(std)] +// Suppress cargo::unused_dependencies lint (since we can’t express “depend on once_cell +// only if not(std)”). +use once_cell as _; + #[cfg(std)] type Inner = LazyLock T>; #[cfg(no_std)] diff --git a/tests/Cargo.toml b/tests/Cargo.toml index b3593096c..d7426f5f4 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -88,8 +88,6 @@ trybuild.workspace = true # Non-Webassembly [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -# Cargo-metadata doesn't compile on wasm due to old cargo-util-schemas dependency. -cargo_metadata.workspace = true env_logger.workspace = true ureq.workspace = true @@ -116,6 +114,11 @@ web-sys = { workspace = true, features = [ "OffscreenCanvasRenderingContext2d", ] } +# Non-Webassembly Dev Dependencies +[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] +# Cargo-metadata doesn't compile on wasm due to old cargo-util-schemas dependency. +cargo_metadata.workspace = true + [lints.clippy] bool_assert_comparison = "allow" disallowed_types = "allow" diff --git a/wgpu-core-remote-types/Cargo.toml b/wgpu-core-remote-types/Cargo.toml index 52b880a3e..55d662524 100644 --- a/wgpu-core-remote-types/Cargo.toml +++ b/wgpu-core-remote-types/Cargo.toml @@ -14,6 +14,9 @@ license.workspace = true # See the repo README for more information on MSRV policy. rust-version = "1.87" +[lints] +workspace = true + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] diff --git a/wgpu-core-remote-types/src/id.rs b/wgpu-core-remote-types/src/id.rs index eb393aec0..14972197c 100644 --- a/wgpu-core-remote-types/src/id.rs +++ b/wgpu-core-remote-types/src/id.rs @@ -28,7 +28,7 @@ const _: () = { #[repr(transparent)] #[derive(serde::Serialize, serde::Deserialize)] #[serde(into = "SerialId", try_from = "SerialId")] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RawId(NonZeroU64); impl RawId { @@ -70,6 +70,7 @@ impl From for SerialId { } } +#[derive(Debug)] pub struct ZeroIdError; impl fmt::Display for ZeroIdError { diff --git a/wgpu-core-remote/Cargo.toml b/wgpu-core-remote/Cargo.toml index fbee5cc23..64e0acce2 100644 --- a/wgpu-core-remote/Cargo.toml +++ b/wgpu-core-remote/Cargo.toml @@ -24,6 +24,9 @@ targets = [ "wasm32-unknown-unknown", ] +[lints] +workspace = true + [features] ## Enables serialization via `serde` on common wgpu types. serde = ["dep:serde", "wgpu-types/serde", "wgpu-core/serde"] diff --git a/wgpu-core-remote/src/hub.rs b/wgpu-core-remote/src/hub.rs index b2405666b..5054b1140 100644 --- a/wgpu-core-remote/src/hub.rs +++ b/wgpu-core-remote/src/hub.rs @@ -84,6 +84,7 @@ flagged as errors as well. This is called [Contagious Invalidity]. */ use alloc::sync::Arc; +use core::fmt; use crate::registry::Registry; use wgpu_core::{ @@ -140,6 +141,15 @@ pub struct Hub { pub(crate) render_bundle_encoders: Registry, } +impl fmt::Debug for Hub { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // Placeholder impl just so that Debug is always implemented, even though not all of our + // fields implement Debug. + // If you find a need for printing actual data here, feel free to add it. + f.debug_struct("Hub").finish_non_exhaustive() + } +} + impl Hub { pub(crate) fn new() -> Self { Self { diff --git a/wgpu-core/platform-deps/linux-android-bsd/Cargo.toml b/wgpu-core/platform-deps/linux-android-bsd/Cargo.toml index 03b03308a..55e01ca2e 100644 --- a/wgpu-core/platform-deps/linux-android-bsd/Cargo.toml +++ b/wgpu-core/platform-deps/linux-android-bsd/Cargo.toml @@ -15,6 +15,9 @@ readme = "README.md" # whole, if their code permits. See `../README.md` for details. rust-version = "1.87" +[lints] +workspace = true + [features] gles = ["wgpu-hal/gles"] vulkan = ["wgpu-hal/vulkan"]