Skip to content

Commit

Permalink
Fix types in documentation for Alignment::as_usize and Alignmnet::as_…
Browse files Browse the repository at this point in the history
…nonzero
  • Loading branch information
tmccombs committed Oct 17, 2022
1 parent 63746be commit a5cfaa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ impl Alignment {
unsafe { mem::transmute::<usize, Alignment>(align) }
}

/// Returns the alignment as a [`NonZeroUsize`]
/// Returns the alignment as a [`usize`]
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
#[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")]
#[inline]
pub const fn as_usize(self) -> usize {
self.0 as usize
}

/// Returns the alignment as a [`usize`]
/// Returns the alignment as a [`NonZeroUsize`]
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
#[inline]
pub const fn as_nonzero(self) -> NonZeroUsize {
Expand Down

0 comments on commit a5cfaa2

Please sign in to comment.