@@ -9,7 +9,7 @@ use crate::{
9
9
Borrowed , Bound , BoundObject , IntoPyObject , IntoPyObjectExt , PyAny , PyErr , PyObject , Python ,
10
10
} ;
11
11
use std:: iter:: FusedIterator ;
12
- #[ cfg( feature = "nightly" ) ]
12
+ #[ cfg( all ( not ( Py_LIMITED_API ) , feature = "nightly" ) ) ]
13
13
use std:: num:: NonZero ;
14
14
15
15
/// Represents a Python `list`.
@@ -548,7 +548,7 @@ impl<'py> BoundListIterator<'py> {
548
548
}
549
549
550
550
#[ inline]
551
- #[ cfg( all( not( Py_LIMITED_API ) , not ( feature = "nightly" ) ) ) ]
551
+ #[ cfg( all( not( Py_LIMITED_API ) , feature = "nightly" ) ) ]
552
552
#[ deny( unsafe_op_in_unsafe_fn) ]
553
553
unsafe fn nth_unchecked (
554
554
index : & mut Index ,
@@ -568,7 +568,7 @@ impl<'py> BoundListIterator<'py> {
568
568
}
569
569
570
570
#[ inline]
571
- #[ cfg( Py_LIMITED_API ) ]
571
+ #[ cfg( all ( Py_LIMITED_API , feature = "nightly" ) ) ]
572
572
#[ deny( unsafe_op_in_unsafe_fn) ]
573
573
fn nth (
574
574
index : & mut Index ,
@@ -630,7 +630,7 @@ impl<'py> BoundListIterator<'py> {
630
630
}
631
631
632
632
#[ inline]
633
- #[ cfg( all( not( Py_LIMITED_API ) , not ( feature = "nightly" ) ) ) ]
633
+ #[ cfg( all( not( Py_LIMITED_API ) , feature = "nightly" ) ) ]
634
634
#[ deny( unsafe_op_in_unsafe_fn) ]
635
635
unsafe fn nth_back_unchecked (
636
636
index : & mut Index ,
@@ -650,7 +650,7 @@ impl<'py> BoundListIterator<'py> {
650
650
}
651
651
652
652
#[ inline]
653
- #[ cfg( Py_LIMITED_API ) ]
653
+ #[ cfg( all ( Py_LIMITED_API , feature = "nightly" ) ) ]
654
654
fn nth_back (
655
655
index : & mut Index ,
656
656
length : & mut Length ,
@@ -705,7 +705,7 @@ impl<'py> Iterator for BoundListIterator<'py> {
705
705
}
706
706
707
707
#[ inline]
708
- #[ cfg( not ( feature = "nightly" ) ) ]
708
+ #[ cfg( feature = "nightly" ) ]
709
709
fn nth ( & mut self , n : usize ) -> Option < Self :: Item > {
710
710
#[ cfg( not( Py_LIMITED_API ) ) ]
711
711
{
@@ -851,7 +851,7 @@ impl<'py> Iterator for BoundListIterator<'py> {
851
851
}
852
852
853
853
#[ inline]
854
- #[ cfg( feature = "nightly" ) ]
854
+ #[ cfg( all ( not ( Py_LIMITED_API ) , feature = "nightly" ) ) ]
855
855
fn advance_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
856
856
self . with_critical_section ( |index, length, list| {
857
857
let max_len = length. 0 . min ( list. len ( ) ) ;
@@ -898,7 +898,7 @@ impl DoubleEndedIterator for BoundListIterator<'_> {
898
898
}
899
899
900
900
#[ inline]
901
- #[ cfg( not ( feature = "nightly" ) ) ]
901
+ #[ cfg( feature = "nightly" ) ]
902
902
fn nth_back ( & mut self , n : usize ) -> Option < Self :: Item > {
903
903
#[ cfg( not( Py_LIMITED_API ) ) ]
904
904
{
0 commit comments