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 ecfddd5 commit e8d8840
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 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-ffi/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ pub unsafe fn Py_TYPE(ob: *mut PyObject) -> *mut PyTypeObject {

#[inline]
pub unsafe fn Py_SIZE(ob: *mut PyObject) -> Py_ssize_t {
debug_assert_ne!((*ob).ob_type, std::ptr::addr_of_mut!(crate::PyLong_Type));
debug_assert_ne!((*ob).ob_type, std::ptr::addr_of_mut!(crate::PyBool_Type));
debug_assert_ne!((*ob).ob_type, addr_of_mut_shim!(crate::PyLong_Type));
debug_assert_ne!((*ob).ob_type, addr_of_mut_shim!(crate::PyBool_Type));
(*ob.cast::<PyVarObject>()).ob_size
}

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,
}

0 comments on commit e8d8840

Please sign in to comment.