Skip to content

Commit 3a7a171

Browse files
committed
Set appropriate Py_LIMITED_API flag
1 parent e88f8be commit 3a7a171

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/types/list.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
Borrowed, Bound, BoundObject, IntoPyObject, IntoPyObjectExt, PyAny, PyErr, PyObject, Python,
1010
};
1111
use std::iter::FusedIterator;
12-
#[cfg(feature = "nightly")]
12+
#[cfg(all(not(Py_LIMITED_API), feature = "nightly"))]
1313
use std::num::NonZero;
1414

1515
/// Represents a Python `list`.
@@ -548,7 +548,7 @@ impl<'py> BoundListIterator<'py> {
548548
}
549549

550550
#[inline]
551-
#[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))]
551+
#[cfg(all(not(Py_LIMITED_API), feature = "nightly"))]
552552
#[deny(unsafe_op_in_unsafe_fn)]
553553
unsafe fn nth_unchecked(
554554
index: &mut Index,
@@ -568,7 +568,7 @@ impl<'py> BoundListIterator<'py> {
568568
}
569569

570570
#[inline]
571-
#[cfg(Py_LIMITED_API)]
571+
#[cfg(all(Py_LIMITED_API, feature = "nightly"))]
572572
#[deny(unsafe_op_in_unsafe_fn)]
573573
fn nth(
574574
index: &mut Index,
@@ -630,7 +630,7 @@ impl<'py> BoundListIterator<'py> {
630630
}
631631

632632
#[inline]
633-
#[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))]
633+
#[cfg(all(not(Py_LIMITED_API), feature = "nightly"))]
634634
#[deny(unsafe_op_in_unsafe_fn)]
635635
unsafe fn nth_back_unchecked(
636636
index: &mut Index,
@@ -650,7 +650,7 @@ impl<'py> BoundListIterator<'py> {
650650
}
651651

652652
#[inline]
653-
#[cfg(Py_LIMITED_API)]
653+
#[cfg(all(Py_LIMITED_API, feature = "nightly"))]
654654
fn nth_back(
655655
index: &mut Index,
656656
length: &mut Length,
@@ -705,7 +705,7 @@ impl<'py> Iterator for BoundListIterator<'py> {
705705
}
706706

707707
#[inline]
708-
#[cfg(not(feature = "nightly"))]
708+
#[cfg(feature = "nightly")]
709709
fn nth(&mut self, n: usize) -> Option<Self::Item> {
710710
#[cfg(not(Py_LIMITED_API))]
711711
{
@@ -851,7 +851,7 @@ impl<'py> Iterator for BoundListIterator<'py> {
851851
}
852852

853853
#[inline]
854-
#[cfg(feature = "nightly")]
854+
#[cfg(all(not(Py_LIMITED_API), feature = "nightly"))]
855855
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
856856
self.with_critical_section(|index, length, list| {
857857
let max_len = length.0.min(list.len());
@@ -898,7 +898,7 @@ impl DoubleEndedIterator for BoundListIterator<'_> {
898898
}
899899

900900
#[inline]
901-
#[cfg(not(feature = "nightly"))]
901+
#[cfg(feature = "nightly")]
902902
fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
903903
#[cfg(not(Py_LIMITED_API))]
904904
{

0 commit comments

Comments
 (0)