Skip to content

Commit 1096df4

Browse files
committed
MSRV 1.89
1 parent b718e75 commit 1096df4

File tree

12 files changed

+34
-46
lines changed

12 files changed

+34
-46
lines changed

.github/workflows/artifact.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
2-
# Copyright ijl (2022-2025), messense (2022), Dominic LoBue (2022)
2+
# Copyright ijl (2022-2026), messense (2022), Dominic LoBue (2022)
33

44
name: artifact
55
on: push
@@ -8,7 +8,7 @@ env:
88
ORJSON_BUILD_FREETHREADED: "1"
99
PIP_DISABLE_PIP_VERSION_CHECK: "1"
1010
RUST_TOOLCHAIN: "nightly-2025-12-01"
11-
RUST_TOOLCHAIN_STABLE: "1.85"
11+
RUST_TOOLCHAIN_STABLE: "1.89"
1212
UNSAFE_PYO3_BUILD_FREE_THREADED: "1"
1313
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
1414
UV_LINK_MODE: "copy"

.github/workflows/unusual.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
cfg: [
17-
{ rust: "1.85", python: "3.15", version_check: "1" },
18-
{ rust: "1.85", python: "3.14", version_check: "0" },
19-
{ rust: "1.85", python: "3.10", version_check: "0" },
17+
{ rust: "1.89", python: "3.15", version_check: "1" },
18+
{ rust: "1.89", python: "3.14", version_check: "0" },
19+
{ rust: "1.89", python: "3.10", version_check: "0" },
2020
]
2121
steps:
2222
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${{ matrix.cfg.rust }} --profile minimal -y

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "Fast, correct Python JSON library supporting dataclasses, datetim
66
repository = "https://github.com/ijl/orjson"
77
edition = "2024"
88
resolver = "3"
9-
rust-version = "1.85"
9+
rust-version = "1.89"
1010
license = "MPL-2.0 AND (Apache-2.0 OR MIT)"
1111
keywords = ["fast", "json", "dataclass", "dataclasses", "datetime", "rfc", "8259", "3339"]
1212
include = [

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,15 +1068,15 @@ functions and objects using the normal `PyImport_*` APIs.
10681068

10691069
## Packaging
10701070

1071-
To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.85,
1071+
To package orjson requires at least [Rust](https://www.rust-lang.org/) 1.89,
10721072
a C compiler, and the [maturin](https://github.com/PyO3/maturin) build tool.
10731073
The recommended build command is:
10741074

10751075
```sh
10761076
maturin build --release --strip
10771077
```
10781078

1079-
The project's own CI tests against `nightly-2025-12-01` and stable 1.85. It
1079+
The project's own CI tests against `nightly-2025-12-01` and stable 1.89. It
10801080
is prudent to pin the nightly version because that channel can introduce
10811081
breaking changes. There is a significant performance benefit to using
10821082
nightly.

build.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2-
// Copyright ijl (2021-2025)
2+
// Copyright ijl (2021-2026)
33

44
fn main() {
55
let python_config = pyo3_build_config::get();
@@ -8,10 +8,6 @@ fn main() {
88
not_supported("free-threaded Python")
99
}
1010

11-
for cfg in python_config.build_script_outputs() {
12-
println!("{cfg}");
13-
}
14-
1511
#[allow(unused_variables)]
1612
let is_64_bit_python = matches!(python_config.pointer_width, Some(64));
1713

@@ -27,6 +23,10 @@ fn main() {
2723
pyo3_build_config::PythonImplementation::PyPy => not_supported("PyPy"),
2824
}
2925

26+
for cfg in python_config.build_script_outputs() {
27+
println!("{cfg}");
28+
}
29+
3030
println!("cargo:rerun-if-changed=build.rs");
3131
println!("cargo:rerun-if-changed=include/yyjson/*");
3232
println!("cargo:rerun-if-env-changed=CC");
@@ -48,7 +48,7 @@ fn main() {
4848
println!("cargo:rustc-check-cfg=cfg(PyPy)");
4949

5050
#[cfg(all(target_arch = "x86_64", not(target_os = "macos")))]
51-
if version_check::is_min_version("1.89.0").unwrap_or(false) && is_64_bit_python {
51+
if is_64_bit_python {
5252
println!("cargo:rustc-cfg=feature=\"avx512\"");
5353
}
5454

src/ffi/fragment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn raise_args_exception() {
5252
unsafe {
5353
let msg = "orjson.Fragment() takes exactly 1 positional argument";
5454
let err_msg =
55-
PyUnicode_FromStringAndSize(msg.as_ptr().cast::<c_char>(), msg.len() as isize);
55+
PyUnicode_FromStringAndSize(msg.as_ptr().cast::<c_char>(), msg.len().cast_signed());
5656
PyErr_SetObject(PyExc_TypeError, err_msg);
5757
Py_DECREF(err_msg);
5858
};
@@ -151,7 +151,7 @@ pub(crate) unsafe extern "C" fn orjson_fragmenttype_new() -> *mut PyTypeObject {
151151
_ob_size_graalpy: 0,
152152
},
153153
tp_name: c"orjson.Fragment".as_ptr(),
154-
tp_basicsize: core::mem::size_of::<Fragment>() as isize,
154+
tp_basicsize: core::mem::size_of::<Fragment>().cast_signed(),
155155
tp_itemsize: 0,
156156
tp_dealloc: Some(orjson_fragment_dealloc),
157157
tp_init: None,

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
#![cfg_attr(feature = "generic_simd", feature(portable_simd))]
66
#![cfg_attr(feature = "cold_path", feature(cold_path))]
77
#![allow(non_camel_case_types)]
8-
#![allow(stable_features)] // MSRV
98
#![allow(static_mut_refs)]
10-
#![allow(unknown_lints)] // internal_features
119
#![allow(unused_unsafe)]
1210
#![warn(clippy::correctness)]
1311
#![warn(clippy::suspicious)]
@@ -27,7 +25,6 @@
2725
#![allow(clippy::host_endian_bytes)]
2826
#![allow(clippy::if_not_else)]
2927
#![allow(clippy::implicit_return)]
30-
#![allow(clippy::incompatible_msrv)] // MSRV 1.89
3128
#![allow(clippy::inline_always)]
3229
#![allow(clippy::let_underscore_untyped)]
3330
#![allow(clippy::missing_assert_message)]

src/serialize/per_type/datetime.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
2-
// Copyright ijl (2018-2025), Ben Sully (2021)
2+
// Copyright ijl (2018-2026), Ben Sully (2021)
33

44
use crate::opt::{OMIT_MICROSECONDS, Opt};
55
use crate::serialize::buffer::SmallFixedBuffer;
@@ -60,16 +60,14 @@ impl Date {
6060
{
6161
let val_py = ffi!(PyDateTime_GET_MONTH(self.ptr));
6262
debug_assert!(val_py >= 0);
63-
#[allow(clippy::cast_sign_loss)]
64-
let val = val_py as u32;
63+
let val = val_py.cast_unsigned();
6564
write_double_digit!(buf, val);
6665
}
6766
buf.put_u8(b'-');
6867
{
6968
let val_py = ffi!(PyDateTime_GET_DAY(self.ptr));
7069
debug_assert!(val_py >= 0);
71-
#[allow(clippy::cast_sign_loss)]
72-
let val = val_py as u32;
70+
let val = val_py.cast_unsigned();
7371
write_double_digit!(buf, val);
7472
}
7573
}
@@ -110,16 +108,16 @@ impl Time {
110108
if unsafe { (*self.ptr.cast::<crate::ffi::PyDateTime_Time>()).hastzinfo == 1 } {
111109
return Err(TimeError::HasTimezone);
112110
}
113-
let hour = ffi!(PyDateTime_TIME_GET_HOUR(self.ptr)) as u8;
111+
let hour = ffi!(PyDateTime_TIME_GET_HOUR(self.ptr)).cast_unsigned();
114112
write_double_digit!(buf, hour);
115113
buf.put_u8(b':');
116-
let minute = ffi!(PyDateTime_TIME_GET_MINUTE(self.ptr)) as u8;
114+
let minute = ffi!(PyDateTime_TIME_GET_MINUTE(self.ptr)).cast_unsigned();
117115
write_double_digit!(buf, minute);
118116
buf.put_u8(b':');
119-
let second = ffi!(PyDateTime_TIME_GET_SECOND(self.ptr)) as u8;
117+
let second = ffi!(PyDateTime_TIME_GET_SECOND(self.ptr)).cast_unsigned();
120118
write_double_digit!(buf, second);
121119
if opt_disabled!(self.opts, OMIT_MICROSECONDS) {
122-
let microsecond = ffi!(PyDateTime_TIME_GET_MICROSECOND(self.ptr)) as u32;
120+
let microsecond = ffi!(PyDateTime_TIME_GET_MICROSECOND(self.ptr)).cast_unsigned();
123121
write_microsecond!(buf, microsecond);
124122
}
125123
Ok(())

src/serialize/per_type/default.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2-
// Copyright ijl (2018-2025)
2+
// Copyright ijl (2018-2026)
33

44
use crate::serialize::error::SerializeError;
55
use crate::serialize::serializer::PyObjectSerializer;
@@ -30,8 +30,7 @@ impl Serialize for DefaultSerializer<'_> {
3030
cold_path!();
3131
err!(SerializeError::DefaultRecursionLimit)
3232
}
33-
#[allow(clippy::cast_sign_loss)]
34-
let nargs = ffi!(PyVectorcall_NARGS(1)) as usize;
33+
let nargs = ffi!(PyVectorcall_NARGS(1)).cast_unsigned() as usize;
3534
let default_obj = unsafe {
3635
crate::ffi::PyObject_Vectorcall(
3736
callable.as_ptr(),

src/serialize/per_type/int.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2-
// Copyright ijl (2018-2025)
2+
// Copyright ijl (2018-2026)
33

44
use crate::opt::{Opt, STRICT_INTEGER};
55
use crate::serialize::error::SerializeError;
@@ -38,8 +38,9 @@ impl Serialize for IntSerializer {
3838
let is_signed = i32::from(!crate::ffi::pylong_is_unsigned(self.ptr));
3939
if crate::ffi::pylong_fits_in_i32(self.ptr) {
4040
if is_signed == 0 {
41-
#[allow(clippy::cast_sign_loss)]
42-
serializer.serialize_u64(crate::ffi::pylong_get_inline_value(self.ptr) as u64)
41+
serializer.serialize_u64(
42+
crate::ffi::pylong_get_inline_value(self.ptr).cast_unsigned(),
43+
)
4344
} else {
4445
serializer.serialize_i64(crate::ffi::pylong_get_inline_value(self.ptr))
4546
}

0 commit comments

Comments
 (0)