Unnamed repository; edit this file 'description' to name the repository.
Depend on both crates individually
Jonas Schievink 2021-08-31
parent e625535 · commit 8969cbb
-rw-r--r--Cargo.lock4
-rw-r--r--crates/cfg/Cargo.toml6
-rw-r--r--crates/cfg/src/cfg_expr.rs2
3 files changed, 7 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 057d23cd28..1842bf46da 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -52,9 +52,6 @@ name = "arbitrary"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "577b08a4acd7b99869f863c50011b01eb73424ccc798ecd996f2e24817adfca7"
-dependencies = [
- "derive_arbitrary",
-]
[[package]]
name = "arrayvec"
@@ -157,6 +154,7 @@ name = "cfg"
version = "0.0.0"
dependencies = [
"arbitrary",
+ "derive_arbitrary",
"expect-test",
"mbe",
"oorandom",
diff --git a/crates/cfg/Cargo.toml b/crates/cfg/Cargo.toml
index 4a0fdd30e0..132505fbf4 100644
--- a/crates/cfg/Cargo.toml
+++ b/crates/cfg/Cargo.toml
@@ -17,5 +17,9 @@ tt = { path = "../tt", version = "0.0.0" }
mbe = { path = "../mbe" }
syntax = { path = "../syntax" }
expect-test = "1.1"
-arbitrary = { version = "1", features = ["derive"] }
oorandom = "11"
+# We depend on both individually instead of using `features = ["derive"]` to microoptimize the
+# build graph: if the feature was enabled, syn would be built early on in the graph if `smolstr`
+# supports `arbitrary`. This way, we avoid feature unification.
+arbitrary = "1"
+derive_arbitrary = "1"
diff --git a/crates/cfg/src/cfg_expr.rs b/crates/cfg/src/cfg_expr.rs
index a06f0f4480..c980e9642a 100644
--- a/crates/cfg/src/cfg_expr.rs
+++ b/crates/cfg/src/cfg_expr.rs
@@ -50,7 +50,7 @@ impl fmt::Display for CfgAtom {
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-#[cfg_attr(test, derive(arbitrary::Arbitrary))]
+#[cfg_attr(test, derive(derive_arbitrary::Arbitrary))]
pub enum CfgExpr {
Invalid,
Atom(CfgAtom),