Bug Description
In PR #5547 the addition of PyDict_ClearWatcher needs c_int. But it is conditionally removed for pypy 3.12 in pyo3-ffi/src/cpython/dictobject.rs. Now that I am testing pyO3 on pypy3.12 in preparation for a first 3.12 release, I see the failure.
Steps to Reproduce
- Download a nightly pypy3.12
- run pyo3 tests
Backtrace
Error[E0425]: cannot find type `c_int` in this scope
--> pyo3-ffi/src/cpython/dictobject.rs:134:44
|
134 | pub fn PyDict_ClearWatcher(watcher_id: c_int) -> c_int;
| ^^^^^ not found in this scope
|
note: found an item that was configured out
--> pyo3-ffi/src/cpython/abstract_.rs:5:16
|
4 | #[cfg(not(Py_3_11))]
| --------- the item is gated here
5 | use core::ffi::c_int;
| ^^^^^
note: found an item that was configured out
--> pyo3-ffi/src/cpython/dictobject.rs:14:16
|
13 | #[cfg(all(not(PyPy), Py_3_12))]
| ------ the item is gated here
14 | use core::ffi::c_int;
| ^^^^^
help: consider importing one of these type aliases
|
1 + use std::ffi::c_int;
|
1 + use std::os::raw::c_int;
|
1 + use core::ffi::c_int;
|
1 + use libc::c_int;
Your operating system and version
Ubuntu linux-x86_64 24.04
Your Python version (python --version)
pypy3.12
Your Rust version (rustc --version)
rustc 1.98.0 (88d9e12ae 2026-08-18)
Your PyO3 version
HEAD
How did you install python? Did you use a virtualenv?
downloaded nightly build
Additional Info
I am not a rust expert, but I think the problem is
|
#[cfg(all(not(PyPy), Py_3_12))] |
|
use core::ffi::c_int; |
|
|
Bug Description
In PR #5547 the addition of PyDict_ClearWatcher needs c_int. But it is conditionally removed for pypy 3.12 in pyo3-ffi/src/cpython/dictobject.rs. Now that I am testing pyO3 on pypy3.12 in preparation for a first 3.12 release, I see the failure.
Steps to Reproduce
Backtrace
Your operating system and version
Ubuntu linux-x86_64 24.04
Your Python version (
python --version)pypy3.12
Your Rust version (
rustc --version)rustc 1.98.0 (88d9e12ae 2026-08-18)
Your PyO3 version
HEAD
How did you install python? Did you use a virtualenv?
downloaded nightly build
Additional Info
I am not a rust expert, but I think the problem is
pyo3/pyo3-ffi/src/cpython/dictobject.rs
Lines 13 to 15 in e2b68f3