From 9c29acd6d85b467bb21665aef9babe2cf8fd4887 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Wed, 9 Apr 2025 03:09:13 -0700 Subject: [PATCH] Add serde and wgsl features to wgpu-core (#36411) This fixes errors when running `./mach clippy -r -p layout_2020` and `./mach clippy -r -p script`. Also addressing an unused import warning when running the latter. Testing: These changes do not require tests because it's just a compile error fix. Signed-off-by: Oriol Brufau --- components/script/dom/bindings/buffer_source.rs | 6 ++++-- components/shared/webgpu/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/script/dom/bindings/buffer_source.rs b/components/script/dom/bindings/buffer_source.rs index 054711ef874..dd6984e1eab 100644 --- a/components/script/dom/bindings/buffer_source.rs +++ b/components/script/dom/bindings/buffer_source.rs @@ -34,9 +34,11 @@ use js::rust::{ CustomAutoRooterGuard, Handle, MutableHandleObject, MutableHandleValue as SafeMutableHandleValue, }; +#[cfg(feature = "webgpu")] +use js::typedarray::{ArrayBuffer, HeapArrayBuffer}; use js::typedarray::{ - ArrayBuffer, ArrayBufferU8, ArrayBufferView, ArrayBufferViewU8, CreateWith, HeapArrayBuffer, - TypedArray, TypedArrayElement, TypedArrayElementCreator, + ArrayBufferU8, ArrayBufferView, ArrayBufferViewU8, CreateWith, TypedArray, TypedArrayElement, + TypedArrayElementCreator, }; use crate::dom::bindings::error::{Error, Fallible}; diff --git a/components/shared/webgpu/Cargo.toml b/components/shared/webgpu/Cargo.toml index 8b38af1fa6d..0a4aa4e7ff3 100644 --- a/components/shared/webgpu/Cargo.toml +++ b/components/shared/webgpu/Cargo.toml @@ -18,5 +18,5 @@ ipc-channel = { workspace = true } malloc_size_of = { workspace = true } serde = { workspace = true } webrender_api = { workspace = true } -wgpu-core = { workspace = true } +wgpu-core = { workspace = true, features = ["serde", "wgsl"] } wgpu-types = { workspace = true }