From 7ce422c57aeff31668f3e4d9157f4df284c48a82 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 5 Jan 2024 15:25:26 +0100 Subject: [PATCH] remove naga's clone feature --- naga/Cargo.toml | 1 - naga/src/arena.rs | 4 ++-- naga/src/lib.rs | 24 +++++++----------------- wgpu-core/Cargo.toml | 1 - wgpu-hal/Cargo.toml | 1 - wgpu/Cargo.toml | 1 - 6 files changed, 9 insertions(+), 23 deletions(-) diff --git a/naga/Cargo.toml b/naga/Cargo.toml index a880b6312..df71664ea 100644 --- a/naga/Cargo.toml +++ b/naga/Cargo.toml @@ -21,7 +21,6 @@ all-features = true [features] default = [] -clone = [] dot-out = [] glsl-in = ["pp-rs"] glsl-out = [] diff --git a/naga/src/arena.rs b/naga/src/arena.rs index c37538667..4e5f5af6e 100644 --- a/naga/src/arena.rs +++ b/naga/src/arena.rs @@ -239,7 +239,7 @@ impl Range { /// Adding new items to the arena produces a strongly-typed [`Handle`]. /// The arena can be indexed using the given handle to obtain /// a reference to the stored item. -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Clone)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "serialize", serde(transparent))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -531,7 +531,7 @@ mod tests { /// /// `UniqueArena` is similar to [`Arena`]: If `Arena` is vector-like, /// `UniqueArena` is `HashSet`-like. -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Clone)] pub struct UniqueArena { set: FastIndexSet, diff --git a/naga/src/lib.rs b/naga/src/lib.rs index e55d4bb28..671fcc97c 100644 --- a/naga/src/lib.rs +++ b/naga/src/lib.rs @@ -34,9 +34,6 @@ with optional span info, representing a series of statements executed in order. `EntryPoint`s or `Function` is a `Block`, and `Statement` has a [`Block`][Statement::Block] variant. -If the `clone` feature is enabled, [`Arena`], [`UniqueArena`], [`Type`], [`TypeInner`], -[`Constant`], [`Function`], [`EntryPoint`] and [`Module`] can be cloned. - ## Arenas To improve translator performance and reduce memory usage, most structures are @@ -888,8 +885,7 @@ pub enum Literal { } /// Pipeline-overridable constant. -#[derive(Debug, PartialEq)] -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Debug, PartialEq, Clone)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -907,8 +903,7 @@ pub struct Override { } /// Constant value. -#[derive(Debug, PartialEq)] -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Debug, PartialEq, Clone)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -1908,8 +1903,7 @@ pub struct FunctionResult { } /// A function defined in the module. -#[derive(Debug, Default)] -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Debug, Default, Clone)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -1973,8 +1967,7 @@ pub struct Function { /// [`Location`]: Binding::Location /// [`function`]: EntryPoint::function /// [`stage`]: EntryPoint::stage -#[derive(Debug)] -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Debug, Clone)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -1998,8 +1991,7 @@ pub struct EntryPoint { /// These cannot be spelled in WGSL source. /// /// Stored in [`SpecialTypes::predeclared_types`] and created by [`Module::generate_predeclared_type`]. -#[derive(Debug, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Debug, PartialEq, Eq, Hash, Clone)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -2016,8 +2008,7 @@ pub enum PredeclaredType { } /// Set of special types that can be optionally generated by the frontends. -#[derive(Debug, Default)] -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Debug, Default, Clone)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -2052,8 +2043,7 @@ pub struct SpecialTypes { /// Alternatively, you can load an existing shader using one of the [available front ends][front]. /// /// When finished, you can export modules using one of the [available backends][back]. -#[derive(Debug, Default)] -#[cfg_attr(feature = "clone", derive(Clone))] +#[derive(Debug, Default, Clone)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index a0d3a5b61..c5149053c 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -118,7 +118,6 @@ thiserror = "1" [dependencies.naga] path = "../naga" version = "0.19.0" -features = ["clone"] [dependencies.wgt] package = "wgpu-types" diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index ad1d0a974..5851fdd76 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -179,7 +179,6 @@ ndk-sys = { version = "0.5.0", optional = true } [dependencies.naga] path = "../naga" version = "0.19.0" -features = ["clone"] [build-dependencies] cfg_aliases.workspace = true diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 43605f1f4..41da38ed3 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -177,7 +177,6 @@ static_assertions.workspace = true [dependencies.naga] workspace = true -features = ["clone"] optional = true [build-dependencies]