@@ -18,7 +18,7 @@ foldhash = { version = "0.2.0", default-features = false, optional = true }
18
18
19
19
# For external trait impls
20
20
rayon = { 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 }
22
22
23
23
# When built as part of libstd
24
24
core = { 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,
33
33
# NB: this is a public dependency because `Equivalent` is re-exported!
34
34
equivalent = { version = " 1.0" , optional = true , default-features = false }
35
35
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
+
36
41
[dev-dependencies ]
37
42
lazy_static = " 1.4"
38
43
rand = { version = " 0.9.0" , features = [" small_rng" ] }
@@ -60,6 +65,9 @@ rustc-dep-of-std = [
60
65
" rustc-internal-api" ,
61
66
]
62
67
68
+ # Enables serde support.
69
+ serde = [" dep:serde_core" , " dep:serde" ]
70
+
63
71
# Enables the deprecated RawEntry API.
64
72
raw-entry = []
65
73
0 commit comments