diff --git a/.github/workflows/manylinux_2_28.yaml b/.github/workflows/manylinux_2_28.yaml index f7a255ff..507a94ee 100644 --- a/.github/workflows/manylinux_2_28.yaml +++ b/.github/workflows/manylinux_2_28.yaml @@ -19,7 +19,7 @@ jobs: { version: '3.11', abi: 'cp311-cp311' }, ] env: - PATH: /github/home/.local/bin:/github/home/.cargo/bin:/opt/python/${{ matrix.python.abi }}/bin:/opt/rh/gcc-toolset-11/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + PATH: /github/home/.local/bin:/github/home/.cargo/bin:/opt/python/${{ matrix.python.abi }}/bin:/opt/rh/gcc-toolset-12/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin CC: "clang" CFLAGS: "-O2 -fno-plt -flto=thin" LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed" diff --git a/Cargo.lock b/Cargo.lock index c91788a4..009259d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.76" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" [[package]] name = "cfg-if" @@ -217,13 +217,13 @@ checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "serde" -version = "1.0.147" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" [[package]] name = "serde_json" -version = "1.0.88" +version = "1.0.89" dependencies = [ "itoa", "ryu", diff --git a/Cargo.toml b/Cargo.toml index 7ad9e211..dea6f9a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,6 @@ default = [] unstable-simd = [ "bytecount/generic-simd", "encoding_rs/simd-accel", - "simdutf8/aarch64_neon", ] # Build yyjson as a backend and panic if it fails. The default is to attempt @@ -58,7 +57,7 @@ pyo3-ffi = { version = "0.17", default_features = false, features = ["extension- ryu = { version = "1", default_features = false } serde = { version = "1", default_features = false } serde_json = { path = "include/json", default_features = false, features = ["std", "float_roundtrip"] } -simdutf8 = { version = "0.1", default_features = false, features = ["std"] } +simdutf8 = { version = "0.1", default_features = false, features = ["std", "aarch64_neon"] } smallvec = { version = "^1.10", default_features = false, features = ["union", "write"] } [build-dependencies] diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 88d8f477..699bcd53 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -9,7 +9,7 @@ jobs: container: quay.io/pypa/manylinux_2_28_x86_64:latest variables: interpreter: python3.10 - path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp310-cp310/bin:/opt/rh/gcc-toolset-11/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp310-cp310/bin:/opt/rh/gcc-toolset-12/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin target: x86_64-unknown-linux-gnu toolchain: 1.60.0 steps: @@ -23,7 +23,7 @@ jobs: variables: interpreter: python3.10 compatibility: off - path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp310-cp310/bin:/opt/rh/gcc-toolset-11/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp310-cp310/bin:/opt/rh/gcc-toolset-12/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin steps: - checkout: self - template: ./azure-debug.yml diff --git a/include/json/Cargo.toml b/include/json/Cargo.toml index 6b117ab8..97a48338 100644 --- a/include/json/Cargo.toml +++ b/include/json/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_json" -version = "1.0.88" # remember to update html_root_url +version = "1.0.89" # remember to update html_root_url authors = ["Erick Tryzelaar ", "David Tolnay "] categories = ["encoding", "parser-implementations", "no-std"] description = "A JSON serialization file format" diff --git a/include/json/src/de.rs b/include/json/src/de.rs index 378b7106..88d0f262 100644 --- a/include/json/src/de.rs +++ b/include/json/src/de.rs @@ -451,30 +451,33 @@ impl<'de, R: Read<'de>> Deserializer { &mut self, positive: bool, mut significand: u64, - mut exponent: i32, + exponent_before_decimal_point: i32, ) -> Result { self.eat_char(); + let mut exponent_after_decimal_point = 0; while let c @ b'0'..=b'9' = tri!(self.peek_or_null()) { let digit = (c - b'0') as u64; if overflow!(significand * 10 + digit, u64::max_value()) { + let exponent = exponent_before_decimal_point + exponent_after_decimal_point; return self.parse_decimal_overflow(positive, significand, exponent); } self.eat_char(); significand = significand * 10 + digit; - exponent -= 1; + exponent_after_decimal_point -= 1; } // Error if there is not at least one digit after the decimal point. - if exponent == 0 { + if exponent_after_decimal_point == 0 { match tri!(self.peek()) { Some(_) => return Err(self.peek_error(ErrorCode::InvalidNumber)), None => return Err(self.peek_error(ErrorCode::EofWhileParsingValue)), } } + let exponent = exponent_before_decimal_point + exponent_after_decimal_point; match tri!(self.peek_or_null()) { b'e' | b'E' => self.parse_exponent(positive, significand, exponent), _ => self.f64_from_parts(positive, significand, exponent), diff --git a/include/json/src/lib.rs b/include/json/src/lib.rs index dcd9c841..7c4410dc 100644 --- a/include/json/src/lib.rs +++ b/include/json/src/lib.rs @@ -300,7 +300,7 @@ //! [macro]: https://docs.serde.rs/serde_json/macro.json.html //! [`serde-json-core`]: https://github.com/rust-embedded-community/serde-json-core -#![doc(html_root_url = "https://docs.rs/serde_json/1.0.88")] +#![doc(html_root_url = "https://docs.rs/serde_json/1.0.89")] // Ignored clippy lints #![allow( clippy::collapsible_else_if, diff --git a/include/json/src/ser.rs b/include/json/src/ser.rs index e16fd808..cac4d46f 100644 --- a/include/json/src/ser.rs +++ b/include/json/src/ser.rs @@ -2017,7 +2017,7 @@ where } } -#[cold] +#[inline(never)] fn format_escaped_str_with_escapes( writer: &mut W, formatter: &mut F, diff --git a/include/json/src/value/de.rs b/include/json/src/value/de.rs index 09d69c98..9c266d08 100644 --- a/include/json/src/value/de.rs +++ b/include/json/src/value/de.rs @@ -994,7 +994,7 @@ impl<'de> VariantAccess<'de> for VariantRefDeserializer<'de> { V: Visitor<'de>, { match self.value { - Some(&Value::Array(ref v)) => { + Some(Value::Array(v)) => { if v.is_empty() { visitor.visit_unit() } else { @@ -1021,7 +1021,7 @@ impl<'de> VariantAccess<'de> for VariantRefDeserializer<'de> { V: Visitor<'de>, { match self.value { - Some(&Value::Object(ref v)) => visit_object_ref(v, visitor), + Some(Value::Object(v)) => visit_object_ref(v, visitor), Some(other) => Err(serde::de::Error::invalid_type( other.unexpected(), &"struct variant",