From 3c747e4585e49166629dea551fceea7af8227d0d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 13 Sep 2025 09:34:08 -0700 Subject: [PATCH] Relocate serde_derive version constraint from serde to serde_core This disallows using an old version of serde_derive against a new version of serde_core (with a rename to serde in Cargo.toml). --- serde/Cargo.toml | 8 -------- serde_core/Cargo.toml | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/serde/Cargo.toml b/serde/Cargo.toml index c00fcd66..d58a7dbc 100644 --- a/serde/Cargo.toml +++ b/serde/Cargo.toml @@ -34,14 +34,6 @@ rustdoc-args = [ "--extern-html-root-url=std=https://doc.rust-lang.org", ] -# This cfg cannot be enabled, but it still forces Cargo to keep serde_derive's -# version in lockstep with serde's, even if someone depends on the two crates -# separately with serde's "derive" feature disabled. Every serde_derive release -# is compatible with exactly one serde release because the generated code -# involves nonpublic APIs which are not bound by semver. -[target.'cfg(any())'.dependencies] -serde_derive = { version = "=1.0.219", path = "../serde_derive" } - ### FEATURES ################################################################# diff --git a/serde_core/Cargo.toml b/serde_core/Cargo.toml index 79aca909..02e0ad50 100644 --- a/serde_core/Cargo.toml +++ b/serde_core/Cargo.toml @@ -29,6 +29,14 @@ rustdoc-args = [ "--extern-html-root-url=std=https://doc.rust-lang.org", ] +# This cfg cannot be enabled, but it still forces Cargo to keep serde_derive's +# version in lockstep with serde's, even if someone depends on the two crates +# separately with serde's "derive" feature disabled. Every serde_derive release +# is compatible with exactly one serde release because the generated code +# involves nonpublic APIs which are not bound by semver. +[target.'cfg(any())'.dependencies] +serde_derive = { version = "=1.0.219", path = "../serde_derive" } + ### FEATURES #################################################################