Skip to content

Commit

Permalink
fix msrv issues for 0.19.2 patch release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Jul 30, 2023
1 parent f19d687 commit ac67f7e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ def set_minimal_package_versions(session: nox.Session):
"trybuild": "1.0.76",
# pins to avoid syn 2.0 (which requires Rust 1.56)
"ghost": "0.1.8",
"serde_json": "1.0.99",
"serde": "1.0.156",
"serde_derive": "1.0.156",
"cxx": "1.0.92",
Expand All @@ -508,6 +509,9 @@ def set_minimal_package_versions(session: nox.Session):
"js-sys": "0.3.61",
"wasm-bindgen": "0.2.84",
"syn": "1.0.109",
# proc-macro2 1.0.66+ is edition 2021
"quote": "1.0.30",
"proc-macro2": "1.0.65",
}
# run cargo update first to ensure that everything is at highest
# possible version, so that this matches what CI will resolve to.
Expand Down
8 changes: 4 additions & 4 deletions pyo3-ffi/src/cpython/abstract_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ extern "C" {
) -> *mut PyObject;
}

#[cfg(all(Py_3_8))]
#[cfg(Py_3_8)]
const PY_VECTORCALL_ARGUMENTS_OFFSET: Py_ssize_t =
1 << (8 * std::mem::size_of::<Py_ssize_t>() as Py_ssize_t - 1);

#[cfg(all(Py_3_8))]
#[cfg(Py_3_8)]
#[inline(always)]
pub unsafe fn PyVectorcall_NARGS(n: size_t) -> Py_ssize_t {
assert!(n <= (PY_SSIZE_T_MAX as size_t));
Expand Down Expand Up @@ -113,7 +113,7 @@ extern "C" {
kwnames: *mut PyObject,
) -> *mut PyObject;

#[cfg(all(Py_3_8))]
#[cfg(Py_3_8)]
#[cfg_attr(all(not(PyPy), not(Py_3_9)), link_name = "_PyObject_VectorcallDict")]
#[cfg_attr(all(PyPy, not(Py_3_9)), link_name = "_PyPyObject_VectorcallDict")]
#[cfg_attr(all(PyPy, Py_3_9), link_name = "PyPyObject_VectorcallDict")]
Expand All @@ -124,7 +124,7 @@ extern "C" {
kwdict: *mut PyObject,
) -> *mut PyObject;

#[cfg(all(Py_3_8))]
#[cfg(Py_3_8)]
#[cfg_attr(not(any(Py_3_9, PyPy)), link_name = "_PyVectorcall_Call")]
#[cfg_attr(PyPy, link_name = "PyPyVectorcall_Call")]
pub fn PyVectorcall_Call(
Expand Down
4 changes: 2 additions & 2 deletions pyo3-macros-backend/src/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ pub fn parse_method_receiver(arg: &syn::FnArg) -> Result<SelfType> {
) => {
bail_spanned!(recv.span() => RECEIVER_BY_VALUE_ERR);
}
syn::FnArg::Receiver(recv @ syn::Receiver { mutability, .. }) => Ok(SelfType::Receiver {
mutable: mutability.is_some(),
syn::FnArg::Receiver(recv) => Ok(SelfType::Receiver {
mutable: recv.mutability.is_some(),
span: recv.span(),
}),
syn::FnArg::Typed(syn::PatType { ty, .. }) => {
Expand Down
1 change: 1 addition & 0 deletions pytests/src/pyclasses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ impl EmptyClass {

/// This is for demonstrating how to return a value from __next__
#[pyclass]
#[derive(Default)]
struct PyClassIter {
count: usize,
}
Expand Down
2 changes: 1 addition & 1 deletion src/test_hygiene/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ pub struct Foo4 {
field: i32,

#[pyo3(get, set)]
#[cfg(any(not(FALSE)))]
#[cfg(not(FALSE))]
field: u32,
}
2 changes: 1 addition & 1 deletion src/types/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ fn array_into_tuple<const N: usize>(py: Python<'_>, array: [PyObject; N]) -> Py<
unsafe {
let ptr = ffi::PyTuple_New(N.try_into().expect("0 < N <= 12"));
let tup = Py::from_owned_ptr(py, ptr);
for (index, obj) in array.into_iter().enumerate() {
for (index, obj) in IntoIterator::into_iter(array).enumerate() {
#[cfg(not(any(Py_LIMITED_API, PyPy)))]
ffi::PyTuple_SET_ITEM(ptr, index as ffi::Py_ssize_t, obj.into_ptr());
#[cfg(any(Py_LIMITED_API, PyPy))]
Expand Down

0 comments on commit ac67f7e

Please sign in to comment.