diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 46c427ee0f..2b4ed9dbe9 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -18,6 +18,9 @@ jobs: # nightly is only used by cargo-minimal-versions to regenerate the lock file - run: rustup toolchain add nightly --no-self-update - name: Test all features + env: + RUSTFLAGS: + --cfg dev run: cargo minimal-versions test --all-features --workspace - name: Check snapshots run: git diff --exit-code -- tests/out diff --git a/src/arena.rs b/src/arena.rs index 7f1f117e8e..080a423bda 100644 --- a/src/arena.rs +++ b/src/arena.rs @@ -161,7 +161,7 @@ impl Iterator for 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. -#[derive(Clone)] +#[cfg_attr(not(dev), derive(Clone))] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "serialize", serde(transparent))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -413,7 +413,7 @@ mod tests { /// /// `UniqueArena` is similar to [`Arena`]: If `Arena` is vector-like, /// `UniqueArena` is `HashSet`-like. -#[derive(Clone)] +#[cfg_attr(not(dev), derive(Clone))] pub struct UniqueArena { set: IndexSet, diff --git a/src/lib.rs b/src/lib.rs index 31d44429dd..1fa964e2a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -556,7 +556,8 @@ pub enum ImageClass { } /// A data type declared in the module. -#[derive(Clone, Debug, Eq, Hash, PartialEq)] +#[derive(Debug, Eq, Hash, PartialEq)] +#[cfg_attr(not(dev), derive(Clone))] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -568,7 +569,8 @@ pub struct Type { } /// Enum with additional information, depending on the kind of type. -#[derive(Clone, Debug, Eq, Hash, PartialEq)] +#[derive(Debug, Eq, Hash, PartialEq)] +#[cfg_attr(not(dev), derive(Clone))] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -744,7 +746,8 @@ pub enum TypeInner { } /// Constant value. -#[derive(Clone, Debug, PartialEq)] +#[derive(Debug, PartialEq)] +#[cfg_attr(not(dev), derive(Clone))] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -1582,7 +1585,8 @@ pub struct FunctionResult { } /// A function defined in the module. -#[derive(Clone, Debug, Default)] +#[derive(Debug, Default)] +#[cfg_attr(not(dev), derive(Clone))] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -1646,7 +1650,8 @@ pub struct Function { /// [`Location`]: Binding::Location /// [`function`]: EntryPoint::function /// [`stage`]: EntryPoint::stage -#[derive(Clone, Debug)] +#[derive(Debug)] +#[cfg_attr(not(dev), derive(Clone))] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] @@ -1676,7 +1681,8 @@ pub struct EntryPoint { /// 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(Clone, Debug, Default)] +#[derive(Debug, Default)] +#[cfg_attr(not(dev), derive(Clone))] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))]