diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-16 08:17:33 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-16 08:17:33 +0000 |
commit | 78f95ce9b0a06e67d6640e96ac3b1ca846f1f08f (patch) | |
tree | 944dd49676b5a1fbc7916dd2f43ce03118ec1bae | |
parent | 7659780bcb3e26e940d2e566d01cefa69d355abe (diff) | |
parent | d4f67d3572854b980a23fe88694f20447b9e955b (diff) | |
download | serde-78f95ce9b0a06e67d6640e96ac3b1ca846f1f08f.tar.gz |
Snap for 8189365 from d4f67d3572854b980a23fe88694f20447b9e955b to tm-frc-networking-release
Change-Id: Ieddb4394d50983afabcb6e99b4ee5efff05c4b1f
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 49 | ||||
-rw-r--r-- | Cargo.toml | 13 | ||||
-rw-r--r-- | Cargo.toml.orig | 4 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | TEST_MAPPING | 81 | ||||
-rw-r--r-- | build.rs | 10 | ||||
-rw-r--r-- | cargo2android.json | 8 | ||||
-rw-r--r-- | patches/Android.bp.patch | 13 | ||||
-rw-r--r-- | src/de/mod.rs | 6 | ||||
-rw-r--r-- | src/lib.rs | 4 | ||||
-rw-r--r-- | src/private/de.rs | 4 | ||||
-rw-r--r-- | src/private/mod.rs | 1 | ||||
-rw-r--r-- | src/ser/mod.rs | 30 |
14 files changed, 66 insertions, 167 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index d722bd8..1eff8ec 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "65e1a50749938612cfbdb69b57fc4cf249f87149" + "sha1": "e9270e59f0c46817899dd61119674396f24c2b3e" } } @@ -42,8 +42,6 @@ rust_library { name: "libserde", host_supported: true, crate_name: "serde", - cargo_env_compat: true, - cargo_pkg_version: "1.0.130", srcs: ["src/lib.rs"], edition: "2015", features: [ @@ -60,13 +58,13 @@ rust_library { "de_boxed_path", "de_rc_dst", "integer128", - "iterator_try_fold", "num_nonzero", "num_nonzero_signed", "ops_bound", "range_inclusive", "serde_derive", "std_atomic", + // "std_atomic64", // not for arm/arm64 "systemtime_checked_add", ], proc_macros: ["libserde_derive"], @@ -74,44 +72,11 @@ rust_library { "//apex_available:platform", "com.android.virt", ], - vendor_available: true, } -rust_test { - name: "serde_test_src_lib", - host_supported: true, - crate_name: "serde", - cargo_env_compat: true, - cargo_pkg_version: "1.0.130", - srcs: ["src/lib.rs"], - test_suites: ["general-tests"], - auto_gen_config: true, - test_options: { - unit_test: true, - }, - edition: "2015", - features: [ - "default", - "derive", - "serde_derive", - "std", - ], - cfgs: [ - "core_duration", - "core_reverse", - "core_try_from", - "de_boxed_c_str", - "de_boxed_path", - "de_rc_dst", - "integer128", - "iterator_try_fold", - "num_nonzero", - "num_nonzero_signed", - "ops_bound", - "range_inclusive", - "serde_derive", - "std_atomic", - "systemtime_checked_add", - ], - proc_macros: ["libserde_derive"], -} +// dependent_library ["feature_list"] +// proc-macro2-1.0.26 "default,proc-macro" +// quote-1.0.9 "default,proc-macro" +// serde_derive-1.0.125 "default" +// syn-1.0.71 "clone-impls,default,derive,parsing,printing,proc-macro,quote" +// unicode-xid-0.2.1 "default" @@ -3,15 +3,16 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies. +# to registry (e.g., crates.io) dependencies # -# If you are reading this file be aware that the original Cargo.toml -# will likely look very different (and much more reasonable). -# See Cargo.toml.orig for the original contents. +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) [package] name = "serde" -version = "1.0.130" +version = "1.0.125" authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"] build = "build.rs" include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] @@ -29,7 +30,7 @@ targets = ["x86_64-unknown-linux-gnu"] [package.metadata.playground] features = ["derive", "rc"] [dependencies.serde_derive] -version = "=1.0.130" +version = "=1.0.125" optional = true [dev-dependencies.serde_derive] version = "1.0" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 7065d99..6488d90 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "serde" -version = "1.0.130" # remember to update html_root_url and serde_derive dependency +version = "1.0.125" # remember to update html_root_url and serde_derive dependency authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"] license = "MIT OR Apache-2.0" description = "A generic serialization/deserialization framework" @@ -14,7 +14,7 @@ include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APAC build = "build.rs" [dependencies] -serde_derive = { version = "=1.0.130", optional = true, path = "../serde_derive" } +serde_derive = { version = "=1.0.125", optional = true, path = "../serde_derive" } [dev-dependencies] serde_derive = { version = "1.0", path = "../serde_derive" } @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/serde/serde-1.0.130.crate" + value: "https://static.crates.io/crates/serde/serde-1.0.125.crate" } - version: "1.0.130" + version: "1.0.125" license_type: NOTICE last_upgrade_date { year: 2021 - month: 9 - day: 22 + month: 4 + day: 13 } } diff --git a/TEST_MAPPING b/TEST_MAPPING index da1479a..b835c6b 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,102 +1,53 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { - "imports": [ - { - "path": "external/rust/crates/base64" - }, - { - "path": "external/rust/crates/bitflags" - }, - { - "path": "external/rust/crates/bytes" - }, - { - "path": "external/rust/crates/either" - }, - { - "path": "external/rust/crates/rand_chacha" - }, - { - "path": "external/rust/crates/serde-xml-rs" - }, - { - "path": "external/rust/crates/serde_cbor" - }, - { - "path": "external/rust/crates/slab" - }, - { - "path": "external/rust/crates/tinytemplate" - }, - { - "path": "external/rust/crates/tinyvec" - }, - { - "path": "external/rust/crates/unicode-bidi" - }, - { - "path": "external/rust/crates/unicode-xid" - }, - { - "path": "external/rust/crates/url" - } - ], "presubmit": [ { - "name": "ZipFuseTest" - }, - { - "name": "apkdmverity.test" - }, - { "name": "authfs_device_test_src_lib" }, { - "name": "keystore2_test" + "name": "either_device_test_src_lib" }, { - "name": "keystore2_test_utils_test" + "name": "serde_cbor_device_test_src_lib" }, { - "name": "legacykeystore_test" + "name": "serde_cbor_device_test_tests_bennofs" }, { - "name": "microdroid_manager_test" + "name": "serde_cbor_device_test_tests_canonical" }, { - "name": "serde_test_src_lib" + "name": "serde_cbor_device_test_tests_de" }, { - "name": "virtualizationservice_device_test" - } - ], - "presubmit-rust": [ + "name": "serde_cbor_device_test_tests_enum" + }, { - "name": "ZipFuseTest" + "name": "serde_cbor_device_test_tests_ser" }, { - "name": "apkdmverity.test" + "name": "serde_cbor_device_test_tests_std_types" }, { - "name": "authfs_device_test_src_lib" + "name": "serde_cbor_device_test_tests_tags" }, { - "name": "keystore2_test" + "name": "serde_cbor_device_test_tests_value" }, { - "name": "keystore2_test_utils_test" + "name": "serde_test_device_test_src_lib" }, { - "name": "legacykeystore_test" + "name": "unicode-bidi_device_test_src_lib" }, { - "name": "microdroid_manager_test" + "name": "url_device_test_src_lib" }, { - "name": "serde_test_src_lib" + "name": "url_device_test_tests_data" }, { - "name": "virtualizationservice_device_test" + "name": "url_device_test_tests_unit" } ] } @@ -53,20 +53,16 @@ fn main() { // 128-bit integers stabilized in Rust 1.26: // https://blog.rust-lang.org/2018/05/10/Rust-1.26.html // - // Disabled on Emscripten targets before Rust 1.40 since - // Emscripten did not support 128-bit integers until Rust 1.40 - // (https://github.com/rust-lang/rust/pull/65251) - if minor >= 26 && (!emscripten || minor >= 40) { + // Disabled on Emscripten targets as Emscripten doesn't + // currently support integers larger than 64 bits. + if minor >= 26 && !emscripten { println!("cargo:rustc-cfg=integer128"); } // Inclusive ranges methods stabilized in Rust 1.27: // https://github.com/rust-lang/rust/pull/50758 - // Also Iterator::try_for_each: - // https://blog.rust-lang.org/2018/06/21/Rust-1.27.html#library-stabilizations if minor >= 27 { println!("cargo:rustc-cfg=range_inclusive"); - println!("cargo:rustc-cfg=iterator_try_fold"); } // Non-zero integers stabilized in Rust 1.28: diff --git a/cargo2android.json b/cargo2android.json index 2a35106..4e40fcb 100644 --- a/cargo2android.json +++ b/cargo2android.json @@ -3,13 +3,9 @@ "//apex_available:platform", "com.android.virt" ], - "cfg-blocklist": [ - "std_atomic64" - ], "dependencies": true, "device": true, "features": "default,derive", - "run": true, - "tests": true, - "vendor-available": true + "patch": "patches/Android.bp.patch", + "run": true }
\ No newline at end of file diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch new file mode 100644 index 0000000..071947f --- /dev/null +++ b/patches/Android.bp.patch @@ -0,0 +1,13 @@ +diff --git b/Android.bp a/Android.bp +index 41d67cc..277296f 100644 +--- b/Android.bp ++++ a/Android.bp +@@ -64,7 +64,7 @@ + "range_inclusive", + "serde_derive", + "std_atomic", +- "std_atomic64", ++ // "std_atomic64", // not for arm/arm64 + "systemtime_checked_add", + ], + proc_macros: ["libserde_derive"], diff --git a/src/de/mod.rs b/src/de/mod.rs index 54e2fd6..1ed7b4f 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -1007,7 +1007,7 @@ pub trait Deserializer<'de>: Sized { /// `Deserializer`. /// /// If the `Visitor` would benefit from taking ownership of `String` data, - /// indicate this to the `Deserializer` by using `deserialize_string` + /// indiciate this to the `Deserializer` by using `deserialize_string` /// instead. fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where @@ -1714,7 +1714,7 @@ pub trait SeqAccess<'de> { } } -impl<'de, 'a, A: ?Sized> SeqAccess<'de> for &'a mut A +impl<'de, 'a, A> SeqAccess<'de> for &'a mut A where A: SeqAccess<'de>, { @@ -1867,7 +1867,7 @@ pub trait MapAccess<'de> { } } -impl<'de, 'a, A: ?Sized> MapAccess<'de> for &'a mut A +impl<'de, 'a, A> MapAccess<'de> for &'a mut A where A: MapAccess<'de>, { @@ -84,7 +84,7 @@ //////////////////////////////////////////////////////////////////////////////// // Serde types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/serde/1.0.130")] +#![doc(html_root_url = "https://docs.rs/serde/1.0.125")] // Support using Serde without the standard library! #![cfg_attr(not(feature = "std"), no_std)] // Unstable functionality only if the user asks for it. For tracking and @@ -157,7 +157,7 @@ mod lib { pub use std::*; } - pub use self::core::{cmp, iter, mem, num, ptr, slice, str}; + pub use self::core::{cmp, iter, mem, num, slice, str}; pub use self::core::{f32, f64}; pub use self::core::{i16, i32, i64, i8, isize}; pub use self::core::{u16, u32, u64, u8, usize}; diff --git a/src/private/de.rs b/src/private/de.rs index a387d40..9199816 100644 --- a/src/private/de.rs +++ b/src/private/de.rs @@ -2832,7 +2832,7 @@ where where T: DeserializeSeed<'de>, { - for item in &mut self.iter { + while let Some(item) = self.iter.next() { // Items in the vector are nulled out when used by a struct. if let Some((ref key, ref content)) = *item { self.pending_content = Some(content); @@ -2934,7 +2934,7 @@ where where T: DeserializeSeed<'de>, { - for item in &mut self.iter { + while let Some(item) = self.iter.next() { if let Some((ref key, ref content)) = *item { // Do not take(), instead borrow this entry. The internally tagged // enum does its own buffering so we can't tell whether this entry diff --git a/src/private/mod.rs b/src/private/mod.rs index 71e82a8..24ea84b 100644 --- a/src/private/mod.rs +++ b/src/private/mod.rs @@ -14,7 +14,6 @@ pub use lib::default::Default; pub use lib::fmt::{self, Formatter}; pub use lib::marker::PhantomData; pub use lib::option::Option::{self, None, Some}; -pub use lib::ptr; pub use lib::result::Result::{self, Err, Ok}; pub use self::string::from_utf8_lossy; diff --git a/src/ser/mod.rs b/src/ser/mod.rs index d5bca09..d686c5a 100644 --- a/src/ser/mod.rs +++ b/src/ser/mod.rs @@ -1279,20 +1279,9 @@ pub trait Serializer: Sized { { let iter = iter.into_iter(); let mut serializer = try!(self.serialize_seq(iterator_len_hint(&iter))); - - #[cfg(iterator_try_fold)] - { - let mut iter = iter; - try!(iter.try_for_each(|item| serializer.serialize_element(&item))); - } - - #[cfg(not(iterator_try_fold))] - { - for item in iter { - try!(serializer.serialize_element(&item)); - } + for item in iter { + try!(serializer.serialize_element(&item)); } - serializer.end() } @@ -1330,20 +1319,9 @@ pub trait Serializer: Sized { { let iter = iter.into_iter(); let mut serializer = try!(self.serialize_map(iterator_len_hint(&iter))); - - #[cfg(iterator_try_fold)] - { - let mut iter = iter; - try!(iter.try_for_each(|(key, value)| serializer.serialize_entry(&key, &value))); - } - - #[cfg(not(iterator_try_fold))] - { - for (key, value) in iter { - try!(serializer.serialize_entry(&key, &value)); - } + for (key, value) in iter { + try!(serializer.serialize_entry(&key, &value)); } - serializer.end() } |