diff --git a/src/buffer.rs b/src/buffer.rs index 672ab32c..07f6321a 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -1,5 +1,4 @@ #![cfg(not(Py_LIMITED_API))] -#![cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))] // Copyright (c) 2017 Daniel Grunwald // // Permission is hereby granted, free of charge, to any person obtaining a copy of this diff --git a/src/class/mod.rs b/src/class/mod.rs index 29315a82..4b7543aa 100644 --- a/src/class/mod.rs +++ b/src/class/mod.rs @@ -7,7 +7,6 @@ mod macros; pub mod basic; #[cfg(not(Py_LIMITED_API))] -#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))] pub mod buffer; pub mod context; pub mod descr; @@ -24,7 +23,6 @@ pub mod sequence; pub use self::basic::PyObjectProtocol; #[cfg(not(Py_LIMITED_API))] -#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))] pub use self::buffer::PyBufferProtocol; pub use self::context::PyContextProtocol; pub use self::descr::PyDescrProtocol; diff --git a/src/conversions/eyre.rs b/src/conversions/eyre.rs index 445045f7..172f18c5 100644 --- a/src/conversions/eyre.rs +++ b/src/conversions/eyre.rs @@ -1,5 +1,5 @@ #![cfg(feature = "eyre")] -#![cfg_attr(docsrs, doc(cfg(feature = "eyre")))] + //! A conversion from [eyre]’s [`Report`] type to [`PyErr`]. //! //! Use of an error handling library like [eyre] is common in application code and when you just diff --git a/src/conversions/hashbrown.rs b/src/conversions/hashbrown.rs index 3dd65fbe..31b8b142 100644 --- a/src/conversions/hashbrown.rs +++ b/src/conversions/hashbrown.rs @@ -1,5 +1,4 @@ #![cfg(feature = "hashbrown")] -#![cfg_attr(docsrs, doc(cfg(feature = "hashbrown")))] //! Conversions to and from [hashbrown](https://docs.rs/hashbrown/)’s //! `HashMap` and `HashSet`. diff --git a/src/conversions/indexmap.rs b/src/conversions/indexmap.rs index 9ffac69a..c7e20e4c 100644 --- a/src/conversions/indexmap.rs +++ b/src/conversions/indexmap.rs @@ -1,5 +1,4 @@ #![cfg(feature = "indexmap")] -#![cfg_attr(docsrs, doc(cfg(feature = "indexmap")))] //! Conversions to and from [indexmap](https://docs.rs/indexmap/)’s //! `IndexMap`. diff --git a/src/conversions/num_bigint.rs b/src/conversions/num_bigint.rs index 3882ebb0..4defa32b 100644 --- a/src/conversions/num_bigint.rs +++ b/src/conversions/num_bigint.rs @@ -3,11 +3,6 @@ // based on Daniel Grunwald's https://github.com/dgrunwald/rust-cpython #![cfg(all(feature = "num-bigint", not(any(Py_LIMITED_API, PyPy))))] -#![cfg_attr( - docsrs, - doc(cfg(all(feature = "num-bigint", not(any(Py_LIMITED_API, PyPy))))) -)] - //! Conversions to and from [num-bigint](https://docs.rs/num-bigint)’s [`BigInt`] and [`BigUint`] types. //! //! This is useful for converting Python integers when they may not fit in Rust's built-in integer types. diff --git a/src/conversions/num_complex.rs b/src/conversions/num_complex.rs index af822e09..8af3a992 100644 --- a/src/conversions/num_complex.rs +++ b/src/conversions/num_complex.rs @@ -1,5 +1,5 @@ #![cfg(feature = "num-complex")] -#![cfg_attr(docsrs, doc(cfg(feature = "num-complex")))] + //! Conversions to and from [num-complex](https://docs.rs/num-complex)’ //! [`Complex`]`<`[`f32`]`>` and [`Complex`]`<`[`f64`]`>`. //! diff --git a/src/conversions/serde.rs b/src/conversions/serde.rs index e6571e2f..b9dbed07 100644 --- a/src/conversions/serde.rs +++ b/src/conversions/serde.rs @@ -1,4 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] #![cfg(feature = "serde")] //! Enables (de)serialization of [`Py`]`` objects via [serde](https://docs.rs/serde). diff --git a/src/ffi/abstract_.rs b/src/ffi/abstract_.rs index b223dee2..3fa035b3 100644 --- a/src/ffi/abstract_.rs +++ b/src/ffi/abstract_.rs @@ -113,7 +113,6 @@ extern "C" { #[cfg_attr(PyPy, link_name = "PyPyIter_Next")] pub fn PyIter_Next(arg1: *mut PyObject) -> *mut PyObject; #[cfg(all(not(PyPy), Py_3_10))] - #[cfg_attr(docsrs, doc(cfg(all(not(PyPy), Py_3_10))))] pub fn PyIter_Send(iter: *mut PyObject, arg: *mut PyObject, presult: *mut *mut PyObject); #[cfg_attr(PyPy, link_name = "PyPyNumber_Check")] diff --git a/src/ffi/cpython/pystate.rs b/src/ffi/cpython/pystate.rs index b132cc4e..3f545450 100644 --- a/src/ffi/cpython/pystate.rs +++ b/src/ffi/cpython/pystate.rs @@ -43,17 +43,14 @@ extern "C" { // skipped _PyThread_CurrentExceptions #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyInterpreterState_Main() -> *mut PyInterpreterState; #[cfg_attr(PyPy, link_name = "PyPyInterpreterState_Head")] pub fn PyInterpreterState_Head() -> *mut PyInterpreterState; #[cfg_attr(PyPy, link_name = "PyPyInterpreterState_Next")] pub fn PyInterpreterState_Next(interp: *mut PyInterpreterState) -> *mut PyInterpreterState; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyInterpreterState_ThreadHead(interp: *mut PyInterpreterState) -> *mut PyThreadState; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyThreadState_Next(tstate: *mut PyThreadState) -> *mut PyThreadState; #[cfg(py_sys_config = "WITH_THREAD")] @@ -62,7 +59,6 @@ extern "C" { } #[cfg(Py_3_9)] -#[cfg_attr(docsrs, doc(cfg(Py_3_9)))] pub type _PyFrameEvalFunction = extern "C" fn( *mut crate::ffi::PyThreadState, *mut crate::ffi::PyFrameObject, @@ -72,13 +68,11 @@ pub type _PyFrameEvalFunction = extern "C" fn( #[cfg(Py_3_9)] extern "C" { /// Get the frame evaluation function. - #[cfg_attr(docsrs, doc(cfg(Py_3_9)))] pub fn _PyInterpreterState_GetEvalFrameFunc( interp: *mut PyInterpreterState, ) -> _PyFrameEvalFunction; ///Set the frame evaluation function. - #[cfg_attr(docsrs, doc(cfg(Py_3_9)))] pub fn _PyInterpreterState_SetEvalFrameFunc( interp: *mut PyInterpreterState, eval_frame: _PyFrameEvalFunction, diff --git a/src/ffi/cpython/unicodeobject.rs b/src/ffi/cpython/unicodeobject.rs index 03400859..2e6e239d 100644 --- a/src/ffi/cpython/unicodeobject.rs +++ b/src/ffi/cpython/unicodeobject.rs @@ -252,7 +252,6 @@ extern "C" { // skipped _PyUnicode_Copy #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyUnicode_CopyCharacters( to: *mut PyObject, to_start: Py_ssize_t, @@ -264,7 +263,6 @@ extern "C" { // skipped _PyUnicode_FastCopyCharacters #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyUnicode_Fill( unicode: *mut PyObject, start: Py_ssize_t, diff --git a/src/ffi/modsupport.rs b/src/ffi/modsupport.rs index 7362c288..30cba10e 100644 --- a/src/ffi/modsupport.rs +++ b/src/ffi/modsupport.rs @@ -54,7 +54,6 @@ extern "C" { // skipped non-limited _PyArg_Fini #[cfg(Py_3_10)] - #[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub fn PyModule_AddObjectRef( module: *mut PyObject, name: *const c_char, diff --git a/src/ffi/object.rs b/src/ffi/object.rs index cd9a96af..d2b09502 100644 --- a/src/ffi/object.rs +++ b/src/ffi/object.rs @@ -353,11 +353,9 @@ extern "C" { pub const Py_PRINT_RAW: c_int = 1; // No string quotes etc. #[cfg(Py_3_10)] -#[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub const Py_TPFLAGS_DISALLOW_INSTANTIATION: c_ulong = 1 << 7; #[cfg(Py_3_10)] -#[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub const Py_TPFLAGS_IMMUTABLETYPE: c_ulong = 1 << 8; /// Set if the type object is dynamically allocated @@ -468,10 +466,8 @@ extern "C" { pub fn Py_DecRef(o: *mut PyObject); #[cfg(Py_3_10)] - #[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub fn Py_NewRef(obj: *mut PyObject) -> *mut PyObject; #[cfg(Py_3_10)] - #[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub fn Py_XNewRef(obj: *mut PyObject) -> *mut PyObject; } diff --git a/src/ffi/objimpl.rs b/src/ffi/objimpl.rs index 3891b902..e627e58e 100644 --- a/src/ffi/objimpl.rs +++ b/src/ffi/objimpl.rs @@ -30,11 +30,10 @@ extern "C" { pub fn PyGC_Collect() -> Py_ssize_t; #[cfg(Py_3_10)] - #[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub fn PyGC_Enable() -> c_int; - #[cfg_attr(docsrs, doc(cfg(Py_3_10)))] + pub fn PyGC_Disable() -> c_int; - #[cfg_attr(docsrs, doc(cfg(Py_3_10)))] + pub fn PyGC_IsEnabled() -> c_int; } diff --git a/src/ffi/pyerrors.rs b/src/ffi/pyerrors.rs index af0c109c..462d983d 100644 --- a/src/ffi/pyerrors.rs +++ b/src/ffi/pyerrors.rs @@ -375,7 +375,6 @@ extern "C" { #[cfg_attr(PyPy, link_name = "PyPyErr_SetInterrupt")] pub fn PyErr_SetInterrupt(); #[cfg(Py_3_10)] - #[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub fn PyErr_SetInterruptEx(signum: c_int); pub fn PyErr_SyntaxLocation(filename: *const c_char, lineno: c_int); pub fn PyErr_SyntaxLocationEx(filename: *const c_char, lineno: c_int, col_offset: c_int); diff --git a/src/ffi/pystate.rs b/src/ffi/pystate.rs index e2f0d9c6..a00af79d 100644 --- a/src/ffi/pystate.rs +++ b/src/ffi/pystate.rs @@ -13,37 +13,28 @@ opaque_struct!(PyInterpreterState); extern "C" { #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyInterpreterState_New() -> *mut PyInterpreterState; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyInterpreterState_Clear(arg1: *mut PyInterpreterState); #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyInterpreterState_Delete(arg1: *mut PyInterpreterState); #[cfg(all(Py_3_9, not(PyPy)))] - #[cfg_attr(docsrs, doc(cfg(all(Py_3_9, not(PyPy)))))] pub fn PyInterpreterState_Get() -> *mut PyInterpreterState; #[cfg(all(Py_3_8, not(PyPy)))] - #[cfg_attr(docsrs, doc(cfg(all(Py_3_8, not(PyPy)))))] pub fn PyInterpreterState_GetDict(arg1: *mut PyInterpreterState) -> *mut PyObject; #[cfg(all(Py_3_7, not(PyPy)))] - #[cfg_attr(docsrs, doc(cfg(all(Py_3_7, not(PyPy)))))] pub fn PyInterpreterState_GetID(arg1: *mut PyInterpreterState) -> i64; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyState_AddModule(arg1: *mut PyObject, arg2: *mut PyModuleDef) -> c_int; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyState_RemoveModule(arg1: *mut PyModuleDef) -> c_int; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyState_FindModule(arg1: *mut PyModuleDef) -> *mut PyObject; #[cfg_attr(PyPy, link_name = "PyPyThreadState_New")] @@ -68,7 +59,6 @@ extern "C" { #[cfg_attr(PyPy, link_name = "PyPyThreadState_GetDict")] pub fn PyThreadState_GetDict() -> *mut PyObject; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyThreadState_SetAsyncExc(arg1: c_long, arg2: *mut PyObject) -> c_int; } @@ -89,6 +79,5 @@ extern "C" { #[cfg_attr(PyPy, link_name = "PyPyGILState_Release")] pub fn PyGILState_Release(arg1: PyGILState_STATE); #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyGILState_GetThisThreadState() -> *mut PyThreadState; } diff --git a/src/ffi/setobject.rs b/src/ffi/setobject.rs index 70d1adb9..7471c5fe 100644 --- a/src/ffi/setobject.rs +++ b/src/ffi/setobject.rs @@ -119,7 +119,6 @@ pub unsafe fn PyAnySet_Check(ob: *mut PyObject) -> c_int { #[inline] #[cfg(Py_3_10)] -#[cfg_attr(docsrs, doc(cfg(Py_3_10)))] pub unsafe fn PySet_CheckExact(op: *mut PyObject) -> c_int { crate::ffi::Py_IS_TYPE(op, &mut PySet_Type) } diff --git a/src/ffi/structseq.rs b/src/ffi/structseq.rs index b164ea2a..d0d45c79 100644 --- a/src/ffi/structseq.rs +++ b/src/ffi/structseq.rs @@ -34,7 +34,6 @@ extern "C" { ) -> c_int; #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyStructSequence_NewType(desc: *mut PyStructSequence_Desc) -> *mut PyTypeObject; #[cfg_attr(PyPy, link_name = "PyPyStructSequence_New")] pub fn PyStructSequence_New(_type: *mut PyTypeObject) -> *mut PyObject; @@ -57,10 +56,8 @@ pub unsafe fn PyStructSequence_GET_ITEM(op: *mut PyObject, i: Py_ssize_t) -> *mu extern "C" { #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyStructSequence_SetItem(arg1: *mut PyObject, arg2: Py_ssize_t, arg3: *mut PyObject); #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn PyStructSequence_GetItem(arg1: *mut PyObject, arg2: Py_ssize_t) -> *mut PyObject; } diff --git a/src/ffi/unicodeobject.rs b/src/ffi/unicodeobject.rs index cbe3bf96..61a60f8c 100644 --- a/src/ffi/unicodeobject.rs +++ b/src/ffi/unicodeobject.rs @@ -166,11 +166,9 @@ extern "C" { #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8String")] pub fn PyUnicode_AsUTF8String(unicode: *mut PyObject) -> *mut PyObject; #[cfg(any(Py_3_10, all(Py_3_7, not(Py_LIMITED_API))))] - #[cfg_attr(docsrs, doc(cfg(any(Py_3_10, not(Py_LIMITED_API)))))] #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8AndSize")] pub fn PyUnicode_AsUTF8AndSize(unicode: *mut PyObject, size: *mut Py_ssize_t) -> *const c_char; #[cfg(not(any(Py_3_7, Py_LIMITED_API)))] - #[cfg_attr(docsrs, doc(cfg(any(Py_3_10, not(Py_LIMITED_API)))))] #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8AndSize")] pub fn PyUnicode_AsUTF8AndSize(unicode: *mut PyObject, size: *mut Py_ssize_t) -> *mut c_char; #[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeUTF32")] diff --git a/src/gil.rs b/src/gil.rs index 4727eac8..01c5d0bf 100644 --- a/src/gil.rs +++ b/src/gil.rs @@ -69,7 +69,6 @@ pub(crate) fn gil_is_acquired() -> bool { /// # } /// ``` #[cfg(not(PyPy))] -#[cfg_attr(docsrs, doc(cfg(not(PyPy))))] #[allow(clippy::collapsible_if)] // for if cfg! pub fn prepare_freethreaded_python() { // Protect against race conditions when Python is not yet initialized and multiple threads @@ -135,7 +134,6 @@ pub fn prepare_freethreaded_python() { /// # } /// ``` #[cfg(not(PyPy))] -#[cfg_attr(docsrs, doc(cfg(not(PyPy))))] #[allow(clippy::collapsible_if)] // for if cfg! pub unsafe fn with_embedded_python_interpreter(f: F) -> R where diff --git a/src/lib.rs b/src/lib.rs index 722f3fff..99b2a789 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -285,7 +285,6 @@ pub use crate::conversion::{ }; pub use crate::err::{PyDowncastError, PyErr, PyErrArguments, PyResult}; #[cfg(not(PyPy))] -#[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub use crate::gil::{prepare_freethreaded_python, with_embedded_python_interpreter}; pub use crate::gil::{GILGuard, GILPool}; pub use crate::instance::{Py, PyNativeType, PyObject}; @@ -351,7 +350,6 @@ pub mod proc_macro { pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto}; } -#[cfg_attr(docsrs, doc(cfg(feature = "macros")))] #[cfg(feature = "macros")] pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto, FromPyObject}; diff --git a/src/marshal.rs b/src/marshal.rs index 95786f9d..1f089dfb 100644 --- a/src/marshal.rs +++ b/src/marshal.rs @@ -1,5 +1,5 @@ #![cfg(not(Py_LIMITED_API))] -#![cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))] + //! Support for the Python `marshal` format. use crate::ffi; diff --git a/src/prelude.rs b/src/prelude.rs index 7fd0cee8..a5c265c6 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -22,6 +22,5 @@ pub use crate::python::Python; pub use crate::types::{PyAny, PyModule}; pub use crate::wrap_pyfunction; -#[cfg_attr(docsrs, doc(cfg(feature = "macros")))] #[cfg(feature = "macros")] pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto, FromPyObject}; diff --git a/src/types/complex.rs b/src/types/complex.rs index a294bfc7..5cd93373 100644 --- a/src/types/complex.rs +++ b/src/types/complex.rs @@ -37,7 +37,6 @@ impl PyComplex { } #[cfg(not(any(Py_LIMITED_API, PyPy)))] -#[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, PyPy)))))] mod not_limited_impls { use super::*; use std::ops::{Add, Div, Mul, Neg, Sub}; diff --git a/src/types/dict.rs b/src/types/dict.rs index bd3d4a71..cf7dbbaf 100644 --- a/src/types/dict.rs +++ b/src/types/dict.rs @@ -39,7 +39,6 @@ impl PyDict { /// Returns an error on invalid input. In the case of key collisions, /// this keeps the last entry seen. #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn from_sequence(py: Python, seq: PyObject) -> PyResult<&PyDict> { unsafe { let dict = py.from_owned_ptr::(ffi::PyDict_New()); diff --git a/src/types/iterator.rs b/src/types/iterator.rs index 869c1be2..6ba44774 100644 --- a/src/types/iterator.rs +++ b/src/types/iterator.rs @@ -71,7 +71,6 @@ impl<'p> Iterator for &'p PyIterator { // PyIter_Check does not exist in the limited API until 3.8 #[cfg(any(not(Py_LIMITED_API), Py_3_8))] -#[cfg_attr(docsrs, doc(cfg(any(not(Py_LIMITED_API), Py_3_8))))] impl<'v> PyTryFrom<'v> for PyIterator { fn try_from>(value: V) -> Result<&'v PyIterator, PyDowncastError<'v>> { let value = value.into(); diff --git a/src/types/list.rs b/src/types/list.rs index 8d3fca54..30c596ce 100644 --- a/src/types/list.rs +++ b/src/types/list.rs @@ -98,7 +98,6 @@ impl PyList { /// /// Caller must verify that the index is within the bounds of the list. #[cfg(not(any(Py_LIMITED_API, PyPy)))] - #[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, PyPy)))))] pub unsafe fn get_item_unchecked(&self, index: usize) -> &PyAny { let item = ffi::PyList_GET_ITEM(self.as_ptr(), index as Py_ssize_t); // PyList_GET_ITEM return borrowed ptr; must make owned for safety (see #890). diff --git a/src/types/mod.rs b/src/types/mod.rs index 817cc175..be3dff66 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -8,7 +8,6 @@ pub use self::bytearray::PyByteArray; pub use self::bytes::PyBytes; pub use self::complex::PyComplex; #[cfg(not(Py_LIMITED_API))] -#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))] pub use self::datetime::{ PyDate, PyDateAccess, PyDateTime, PyDelta, PyDeltaAccess, PyTime, PyTimeAccess, PyTzInfo, }; @@ -225,7 +224,6 @@ mod bytearray; mod bytes; mod complex; #[cfg(not(Py_LIMITED_API))] -#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))] mod datetime; mod dict; mod floatob; diff --git a/src/types/module.rs b/src/types/module.rs index ba3b3138..0121ae16 100644 --- a/src/types/module.rs +++ b/src/types/module.rs @@ -176,7 +176,6 @@ impl PyModule { /// /// May fail if the module does not have a `__file__` attribute. #[cfg(not(all(windows, PyPy)))] - #[cfg_attr(docsrs, doc(cfg(not(all(windows, PyPy)))))] pub fn filename(&self) -> PyResult<&str> { use crate::types::PyString; unsafe { diff --git a/src/types/sequence.rs b/src/types/sequence.rs index c41ec3c8..1a1e1500 100644 --- a/src/types/sequence.rs +++ b/src/types/sequence.rs @@ -183,7 +183,6 @@ impl PySequence { /// number of keys for which `self[key] == value`. #[inline] #[cfg(not(PyPy))] - #[cfg_attr(docsrs, doc(cfg(not(PyPy))))] pub fn count(&self, value: V) -> PyResult where V: ToBorrowedObject, diff --git a/src/types/string.rs b/src/types/string.rs index c934e6f6..61419622 100644 --- a/src/types/string.rs +++ b/src/types/string.rs @@ -16,7 +16,6 @@ use std::str; /// Python internally stores strings in various representations. This enumeration /// represents those variations. #[cfg(not(any(Py_LIMITED_API, target_endian = "big")))] -#[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, target_endian = "big")))))] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PyStringData<'a> { /// UCS1 representation. @@ -225,7 +224,6 @@ impl PyString { /// /// For example, it is known not to work on big-endian platforms. #[cfg(not(any(Py_LIMITED_API, target_endian = "big")))] - #[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, target_endian = "big")))))] pub unsafe fn data(&self) -> PyResult> { let ptr = self.as_ptr(); diff --git a/src/types/tuple.rs b/src/types/tuple.rs index b33a3398..fe9bd6fb 100644 --- a/src/types/tuple.rs +++ b/src/types/tuple.rs @@ -134,7 +134,6 @@ impl PyTuple { /// /// Caller must verify that the index is within the bounds of the tuple. #[cfg(not(any(Py_LIMITED_API, PyPy)))] - #[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, PyPy)))))] pub unsafe fn get_item_unchecked(&self, index: usize) -> &PyAny { let item = ffi::PyTuple_GET_ITEM(self.as_ptr(), index as Py_ssize_t); self.py().from_borrowed_ptr(item) @@ -142,7 +141,6 @@ impl PyTuple { /// Returns `self` as a slice of objects. #[cfg(not(Py_LIMITED_API))] - #[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))] pub fn as_slice(&self) -> &[&PyAny] { // This is safe because &PyAny has the same memory layout as *mut ffi::PyObject, // and because tuples are immutable.