@@ -18,7 +18,7 @@ foldhash = { version = "0.2.0", default-features = false, optional = true }
1818
1919# For external trait impls
2020rayon = { version = " 1.2" , optional = true }
21- serde = { version = " 1.0.25 " , default-features = false , optional = true }
21+ serde_core = { version = " 1.0.221 " , default-features = false , optional = true }
2222
2323# When built as part of libstd
2424core = { version = " 1.0.0" , optional = true , package = " rustc-std-workspace-core" }
@@ -33,6 +33,11 @@ allocator-api2 = { version = "0.2.9", optional = true, default-features = false,
3333# NB: this is a public dependency because `Equivalent` is re-exported!
3434equivalent = { version = " 1.0" , optional = true , default-features = false }
3535
36+ # serde v1.0.220 is the first version that released with `serde_core`.
37+ # This is required to avoid conflict with other `serde` users which may require an older version.
38+ [target .'cfg(any())' .dependencies ]
39+ serde = { version = " 1.0.220" , default-features = false , optional = true }
40+
3641[dev-dependencies ]
3742lazy_static = " 1.4"
3843rand = { version = " 0.9.0" , features = [" small_rng" ] }
@@ -60,6 +65,9 @@ rustc-dep-of-std = [
6065 " rustc-internal-api" ,
6166]
6267
68+ # Enables serde support.
69+ serde = [" dep:serde_core" , " dep:serde" ]
70+
6371# Enables the deprecated RawEntry API.
6472raw-entry = []
6573
0 commit comments