Skip to content

Commit 6be4193

Browse files
committed
Rename serde to serde2, which is a workaround for a major cargo functionality oversight and bug rust-lang/cargo#5730
1 parent a51f831 commit 6be4193

106 files changed

Lines changed: 431 additions & 431 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

serde/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "serde"
2+
name = "serde2"
33
version = "1.0.80" # remember to update html_root_url
44
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
55
license = "MIT/Apache-2.0"
@@ -18,10 +18,10 @@ travis-ci = { repository = "serde-rs/serde" }
1818
appveyor = { repository = "serde-rs/serde" }
1919

2020
[dependencies]
21-
serde_derive = { version = "1.0", optional = true, path = "../serde_derive" }
21+
serde2_derive = { version = "1.0", optional = true, path = "../serde_derive" }
2222

2323
[dev-dependencies]
24-
serde_derive = { version = "1.0", path = "../serde_derive" }
24+
serde2_derive = { version = "1.0", path = "../serde_derive" }
2525

2626

2727
### FEATURES #################################################################
@@ -53,7 +53,7 @@ default = ["std"]
5353
# #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5454
# struct ...
5555
#
56-
derive = ["serde_derive"]
56+
derive = ["serde2_derive"]
5757

5858
# Provide impls for common standard library types like Vec<T> and HashMap<K, V>.
5959
# Requires a dependency on the Rust standard library.

serde/src/de/from_primitive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl_from_primitive_for_uint!(u64);
179179
impl_from_primitive_for_float!(f32);
180180
impl_from_primitive_for_float!(f64);
181181

182-
serde_if_integer128! {
182+
serde2_if_integer128! {
183183
impl FromPrimitive for i128 {
184184
#[inline]
185185
fn from_i8(n: i8) -> Option<Self> {

serde/src/de/ignored_any.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
1212

1313
/// An efficient way of discarding data from a deserializer.
1414
///
15-
/// Think of this like `serde_json::Value` in that it can be deserialized from
15+
/// Think of this like `serde2_json::Value` in that it can be deserialized from
1616
/// any type, except that it does not store any information about the data that
1717
/// gets deserialized.
1818
///
1919
/// ```rust
2020
/// use std::fmt;
2121
/// use std::marker::PhantomData;
2222
///
23-
/// use serde::de::{
23+
/// use serde2::de::{
2424
/// self, Deserialize, DeserializeSeed, Deserializer, IgnoredAny, SeqAccess, Visitor,
2525
/// };
2626
///

serde/src/de/impls.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl_deserialize_num!(usize, deserialize_u64, integer);
176176
impl_deserialize_num!(f32, deserialize_f32, integer, float);
177177
impl_deserialize_num!(f64, deserialize_f64, integer, float);
178178

179-
serde_if_integer128! {
179+
serde2_if_integer128! {
180180
impl<'de> Deserialize<'de> for i128 {
181181
#[inline]
182182
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
@@ -1597,10 +1597,10 @@ impl<'de> Deserialize<'de> for PathBuf {
15971597

15981598
////////////////////////////////////////////////////////////////////////////////
15991599

1600-
// If this were outside of the serde crate, it would just use:
1600+
// If this were outside of the serde2 crate, it would just use:
16011601
//
16021602
// #[derive(Deserialize)]
1603-
// #[serde(variant_identifier)]
1603+
// #[serde2(variant_identifier)]
16041604
#[cfg(all(feature = "std", any(unix, windows)))]
16051605
variant_identifier!{
16061606
OsStringKind (Unix; b"Unix"; 0, Windows; b"Windows"; 1)
@@ -1685,7 +1685,7 @@ forwarded_impl! {
16851685
/// deduplicate `Arc` references to the same data. Every deserialized `Arc`
16861686
/// will end up with a strong count of 1.
16871687
///
1688-
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
1688+
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
16891689
(T), Arc<T>, Arc::new
16901690
}
16911691

@@ -1701,7 +1701,7 @@ forwarded_impl! {
17011701
/// deduplicate `Rc` references to the same data. Every deserialized `Rc`
17021702
/// will end up with a strong count of 1.
17031703
///
1704-
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
1704+
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
17051705
(T), Rc<T>, Rc::new
17061706
}
17071707

@@ -1725,7 +1725,7 @@ where
17251725
/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting
17261726
/// `Weak<T>` has a reference count of 0 and cannot be upgraded.
17271727
///
1728-
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
1728+
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
17291729
#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
17301730
impl<'de, T: ?Sized> Deserialize<'de> for RcWeak<T>
17311731
where
@@ -1743,7 +1743,7 @@ where
17431743
/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting
17441744
/// `Weak<T>` has a reference count of 0 and cannot be upgraded.
17451745
///
1746-
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
1746+
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
17471747
#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
17481748
impl<'de, T: ?Sized> Deserialize<'de> for ArcWeak<T>
17491749
where
@@ -1797,7 +1797,7 @@ box_forwarded_impl! {
17971797
/// deduplicate `Rc` references to the same data. Every deserialized `Rc`
17981798
/// will end up with a strong count of 1.
17991799
///
1800-
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
1800+
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
18011801
Rc
18021802
}
18031803

@@ -1813,7 +1813,7 @@ box_forwarded_impl! {
18131813
/// deduplicate `Arc` references to the same data. Every deserialized `Arc`
18141814
/// will end up with a strong count of 1.
18151815
///
1816-
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
1816+
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
18171817
Arc
18181818
}
18191819

@@ -1844,7 +1844,7 @@ forwarded_impl!((T), RwLock<T>, RwLock::new);
18441844
// This is a cleaned-up version of the impl generated by:
18451845
//
18461846
// #[derive(Deserialize)]
1847-
// #[serde(deny_unknown_fields)]
1847+
// #[serde2(deny_unknown_fields)]
18481848
// struct Duration {
18491849
// secs: u64,
18501850
// nanos: u32,
@@ -1855,10 +1855,10 @@ impl<'de> Deserialize<'de> for Duration {
18551855
where
18561856
D: Deserializer<'de>,
18571857
{
1858-
// If this were outside of the serde crate, it would just use:
1858+
// If this were outside of the serde2 crate, it would just use:
18591859
//
18601860
// #[derive(Deserialize)]
1861-
// #[serde(field_identifier, rename_all = "lowercase")]
1861+
// #[serde2(field_identifier, rename_all = "lowercase")]
18621862
enum Field {
18631863
Secs,
18641864
Nanos,
@@ -2110,7 +2110,7 @@ impl<'de> Deserialize<'de> for SystemTime {
21102110
// Similar to:
21112111
//
21122112
// #[derive(Deserialize)]
2113-
// #[serde(deny_unknown_fields)]
2113+
// #[serde2(deny_unknown_fields)]
21142114
// struct Range {
21152115
// start: u64,
21162116
// end: u32,
@@ -2163,10 +2163,10 @@ mod range {
21632163

21642164
pub const FIELDS: &'static [&'static str] = &["start", "end"];
21652165

2166-
// If this were outside of the serde crate, it would just use:
2166+
// If this were outside of the serde2 crate, it would just use:
21672167
//
21682168
// #[derive(Deserialize)]
2169-
// #[serde(field_identifier, rename_all = "lowercase")]
2169+
// #[serde2(field_identifier, rename_all = "lowercase")]
21702170
enum Field {
21712171
Start,
21722172
End,
@@ -2318,7 +2318,7 @@ nonzero_integers! {
23182318

23192319
// Currently 128-bit integers do not work on Emscripten targets so we need an
23202320
// additional `#[cfg]`
2321-
serde_if_integer128! {
2321+
serde2_if_integer128! {
23222322
nonzero_integers! {
23232323
NonZeroU128,
23242324
}
@@ -2335,10 +2335,10 @@ where
23352335
where
23362336
D: Deserializer<'de>,
23372337
{
2338-
// If this were outside of the serde crate, it would just use:
2338+
// If this were outside of the serde2 crate, it would just use:
23392339
//
23402340
// #[derive(Deserialize)]
2341-
// #[serde(variant_identifier)]
2341+
// #[serde2(variant_identifier)]
23422342
enum Field {
23432343
Ok,
23442344
Err,

0 commit comments

Comments
 (0)