diff --git a/src/array_approx.rs b/src/array_approx.rs
index 958f6f6ba..93d1bd0ac 100644
--- a/src/array_approx.rs
+++ b/src/array_approx.rs
@@ -1,5 +1,4 @@
#[cfg(feature = "approx")]
-#[cfg_attr(docsrs, doc(cfg(feature = "approx")))]
mod approx_methods
{
use crate::imp_prelude::*;
@@ -244,5 +243,4 @@ macro_rules! impl_approx_traits {
}
#[cfg(feature = "approx")]
-#[cfg_attr(docsrs, doc(cfg(feature = "approx")))]
impl_approx_traits!(approx, "**Requires crate feature `\"approx\"`.**");
diff --git a/src/arraytraits.rs b/src/arraytraits.rs
index 08397bf9c..8b214ac9d 100644
--- a/src/arraytraits.rs
+++ b/src/arraytraits.rs
@@ -507,7 +507,6 @@ unsafe impl Sync for ArrayRef where A: Sync {}
unsafe impl Send for ArrayRef where A: Send {}
#[cfg(feature = "serde")]
-#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
// Use version number so we can add a packed format later.
pub const ARRAY_FORMAT_VERSION: u8 = 1u8;
diff --git a/src/error.rs b/src/error.rs
index e19c32075..eb7395ad8 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -81,7 +81,6 @@ impl PartialEq for ShapeError
}
#[cfg(feature = "std")]
-#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl Error for ShapeError {}
impl fmt::Display for ShapeError
diff --git a/src/impl_constructors.rs b/src/impl_constructors.rs
index ded1bbf79..ba01e2ca3 100644
--- a/src/impl_constructors.rs
+++ b/src/impl_constructors.rs
@@ -99,7 +99,6 @@ where S: DataOwned
/// assert!(array == arr1(&[0.0, 0.25, 0.5, 0.75, 1.0]))
/// ```
#[cfg(feature = "std")]
- #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn linspace(start: A, end: A, n: usize) -> Self
where A: Float
{
@@ -118,7 +117,6 @@ where S: DataOwned
/// assert!(array == arr1(&[0., 1., 2., 3., 4.]))
/// ```
#[cfg(feature = "std")]
- #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn range(start: A, end: A, step: A) -> Self
where A: Float
{
@@ -147,7 +145,6 @@ where S: DataOwned
/// # }
/// ```
#[cfg(feature = "std")]
- #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn logspace(base: A, start: A, end: A, n: usize) -> Self
where A: Float
{
@@ -182,7 +179,6 @@ where S: DataOwned
/// # example().unwrap();
/// ```
#[cfg(feature = "std")]
- #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn geomspace(start: A, end: A, n: usize) -> Option
where A: Float
{
diff --git a/src/lib.rs b/src/lib.rs
index 6a5ea8280..41e5ca350 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -22,6 +22,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
// Enable the doc_cfg nightly feature for including feature gate flags in the documentation
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![warn(missing_docs)]
//! The `ndarray` crate provides an *n*-dimensional container for general elements
@@ -158,7 +159,6 @@ use crate::iterators::{ElementsBase, ElementsBaseMut};
pub use crate::arraytraits::AsArray;
pub use crate::linalg_traits::LinalgScalar;
#[cfg(feature = "std")]
-#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub use crate::linalg_traits::NdFloat;
pub use crate::stacking::{concatenate, stack};
@@ -201,11 +201,9 @@ mod layout;
mod linalg_traits;
mod linspace;
#[cfg(feature = "std")]
-#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub use crate::linspace::{linspace, range, Linspace};
mod logspace;
#[cfg(feature = "std")]
-#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub use crate::logspace::{logspace, Logspace};
mod math_cell;
mod numeric_util;
@@ -1841,7 +1839,6 @@ where
// parallel methods
#[cfg(feature = "rayon")]
-#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
pub mod parallel;
mod impl_1d;
diff --git a/src/linalg_traits.rs b/src/linalg_traits.rs
index ec1aebbe7..e77235839 100644
--- a/src/linalg_traits.rs
+++ b/src/linalg_traits.rs
@@ -42,7 +42,6 @@ impl LinalgScalar for T where T: 'static + Copy + Zero + One + Add