Skip to content

Commit

Permalink
move SendablePtr inside of test which uses it
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Mar 22, 2024
1 parent 14b06dd commit 5670357
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ impl UnsendableTraversal {
#[test]
#[cfg(not(target_arch = "wasm32"))] // We are building wasm Python with pthreads disabled
fn unsendable_are_not_traversed_on_foreign_thread() {
#[derive(Clone, Copy)]
struct SendablePtr(*mut pyo3::ffi::PyObject);

unsafe impl Send for SendablePtr {}

Python::with_gil(|py| unsafe {
let ty = py.get_type_bound::<UnsendableTraversal>();
let traverse = get_type_traverse(ty.as_type_ptr()).unwrap();
Expand Down Expand Up @@ -579,8 +584,3 @@ extern "C" fn visit_error(
) -> std::os::raw::c_int {
-1
}

#[derive(Clone, Copy)]
struct SendablePtr(*mut pyo3::ffi::PyObject);

unsafe impl Send for SendablePtr {}

0 comments on commit 5670357

Please sign in to comment.