Skip to content

Remove doc(hidden) attr from items in trait impls #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/data_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ where
}
}

#[doc(hidden)]
unsafe fn clone_from_with_ptr(
&mut self,
other: &Self,
Expand Down
8 changes: 0 additions & 8 deletions src/indexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,22 +180,18 @@ impl<D: Dimension + Copy> NdProducer for Indices<D> {

private_impl! {}

#[doc(hidden)]
fn raw_dim(&self) -> Self::Dim {
self.dim
}

#[doc(hidden)]
fn equal_dim(&self, dim: &Self::Dim) -> bool {
self.dim.equal(dim)
}

#[doc(hidden)]
fn as_ptr(&self) -> Self::Ptr {
IndexPtr { index: self.start }
}

#[doc(hidden)]
fn layout(&self) -> Layout {
if self.dim.ndim() <= 1 {
Layout::one_dimensional()
Expand All @@ -204,19 +200,16 @@ impl<D: Dimension + Copy> NdProducer for Indices<D> {
}
}

#[doc(hidden)]
unsafe fn as_ref(&self, ptr: Self::Ptr) -> Self::Item {
ptr.index.into_pattern()
}

#[doc(hidden)]
unsafe fn uget_ptr(&self, i: &Self::Dim) -> Self::Ptr {
let mut index = *i;
index += &self.start;
IndexPtr { index }
}

#[doc(hidden)]
fn stride_of(&self, axis: Axis) -> Self::Stride {
axis.index()
}
Expand All @@ -226,7 +219,6 @@ impl<D: Dimension + Copy> NdProducer for Indices<D> {
0
}

#[doc(hidden)]
fn split_at(self, axis: Axis, index: usize) -> (Self, Self) {
let start_a = self.start;
let mut start_b = start_a;
Expand Down
9 changes: 1 addition & 8 deletions src/iterators/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,42 +63,34 @@ impl<$($typarm)*> NdProducer for $fulltype {
type Ptr = *mut A;
type Stride = isize;

#[doc(hidden)]
fn raw_dim(&self) -> D {
self.$base.raw_dim()
}

#[doc(hidden)]
fn layout(&self) -> Layout {
self.$base.layout()
}

#[doc(hidden)]
fn as_ptr(&self) -> *mut A {
self.$base.as_ptr() as *mut _
}

#[doc(hidden)]
fn contiguous_stride(&self) -> isize {
self.$base.contiguous_stride()
}

#[doc(hidden)]
unsafe fn as_ref(&$self_, $ptr: *mut A) -> Self::Item {
$refexpr
}

#[doc(hidden)]
unsafe fn uget_ptr(&self, i: &Self::Dim) -> *mut A {
self.$base.uget_ptr(i)
}

#[doc(hidden)]
fn stride_of(&self, axis: Axis) -> isize {
self.$base.stride_of(axis)
}

#[doc(hidden)]
fn split_at(self, axis: Axis, index: usize) -> (Self, Self) {
let (a, b) = self.$base.split_at(axis, index);
($typename {
Expand All @@ -114,6 +106,7 @@ impl<$($typarm)*> NdProducer for $fulltype {
)*
})
}

private_impl!{}
}

Expand Down
22 changes: 8 additions & 14 deletions src/iterators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,15 +1105,14 @@ impl<'a, A, D: Dimension> NdProducer for AxisIter<'a, A, D> {
type Ptr = *mut A;
type Stride = isize;

#[doc(hidden)]
fn layout(&self) -> crate::Layout {
crate::Layout::one_dimensional()
}
#[doc(hidden)]

fn raw_dim(&self) -> Self::Dim {
Ix1(self.len())
}
#[doc(hidden)]

fn as_ptr(&self) -> Self::Ptr {
if self.len() > 0 {
// `self.iter.index` is guaranteed to be in-bounds if any of the
Expand All @@ -1131,28 +1130,26 @@ impl<'a, A, D: Dimension> NdProducer for AxisIter<'a, A, D> {
self.iter.stride
}

#[doc(hidden)]
unsafe fn as_ref(&self, ptr: Self::Ptr) -> Self::Item {
ArrayView::new_(
ptr,
self.iter.inner_dim.clone(),
self.iter.inner_strides.clone(),
)
}
#[doc(hidden)]

unsafe fn uget_ptr(&self, i: &Self::Dim) -> Self::Ptr {
self.iter.offset(self.iter.index + i[0])
}

#[doc(hidden)]
fn stride_of(&self, _axis: Axis) -> isize {
self.contiguous_stride()
}

#[doc(hidden)]
fn split_at(self, _axis: Axis, index: usize) -> (Self, Self) {
self.split_at(index)
}

private_impl! {}
}

Expand All @@ -1162,15 +1159,14 @@ impl<'a, A, D: Dimension> NdProducer for AxisIterMut<'a, A, D> {
type Ptr = *mut A;
type Stride = isize;

#[doc(hidden)]
fn layout(&self) -> crate::Layout {
crate::Layout::one_dimensional()
}
#[doc(hidden)]

fn raw_dim(&self) -> Self::Dim {
Ix1(self.len())
}
#[doc(hidden)]

fn as_ptr(&self) -> Self::Ptr {
if self.len() > 0 {
// `self.iter.index` is guaranteed to be in-bounds if any of the
Expand All @@ -1188,28 +1184,26 @@ impl<'a, A, D: Dimension> NdProducer for AxisIterMut<'a, A, D> {
self.iter.stride
}

#[doc(hidden)]
unsafe fn as_ref(&self, ptr: Self::Ptr) -> Self::Item {
ArrayViewMut::new_(
ptr,
self.iter.inner_dim.clone(),
self.iter.inner_strides.clone(),
)
}
#[doc(hidden)]

unsafe fn uget_ptr(&self, i: &Self::Dim) -> Self::Ptr {
self.iter.offset(self.iter.index + i[0])
}

#[doc(hidden)]
fn stride_of(&self, _axis: Axis) -> isize {
self.contiguous_stride()
}

#[doc(hidden)]
fn split_at(self, _axis: Axis, index: usize) -> (Self, Self) {
self.split_at(index)
}

private_impl! {}
}

Expand Down
2 changes: 1 addition & 1 deletion src/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ macro_rules! private_decl {
() => {
/// This trait is private to implement; this method exists to make it
/// impossible to implement outside the crate.
#[doc(hidden)]
fn __private__(&self) -> crate::private::PrivateMarker;
}
}

macro_rules! private_impl {
() => {
#[doc(hidden)]
fn __private__(&self) -> crate::private::PrivateMarker {
crate::private::PrivateMarker
}
Expand Down
Loading