Skip to content

Commit 7c75510

Browse files
authored
Fix missing std::sync::atomic::Ordering import for targets without atomic64 (#5808)
* Fix missing `std::sync::atomic::Ordering` import for targets without atomic64 * Add changelog for PR #5808 * Fix unused import: `sync::atomic::Ordering`
1 parent 4d4e41c commit 7c75510

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

newsfragments/5808.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix missing `std::sync::atomic::Ordering` import for targets without atomic64.

src/impl_/pymodule.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ use std::{
77
os::raw::{c_int, c_void},
88
};
99

10+
#[cfg(all(
11+
not(any(PyPy, GraalPy)),
12+
Py_3_9,
13+
not(all(windows, Py_LIMITED_API, not(Py_3_10))),
14+
))]
15+
use std::sync::atomic::Ordering;
16+
1017
#[cfg(all(
1118
not(any(PyPy, GraalPy)),
1219
Py_3_9,
@@ -20,7 +27,7 @@ use portable_atomic::AtomicI64;
2027
not(all(windows, Py_LIMITED_API, not(Py_3_10))),
2128
target_has_atomic = "64",
2229
))]
23-
use std::sync::atomic::{AtomicI64, Ordering};
30+
use std::sync::atomic::AtomicI64;
2431

2532
#[cfg(not(any(PyPy, GraalPy)))]
2633
use crate::exceptions::PyImportError;

0 commit comments

Comments
 (0)