Skip to content

Commit

Permalink
Remove Display, LowerExp, UpperExp impls for Alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
clarfonthey committed Oct 13, 2023
1 parent 5c7f096 commit 6651cb6
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions library/core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,6 @@ impl fmt::Debug for Alignment {
}
}

#[unstable(feature = "ptr_alignment_type", issue = "102070")]
impl fmt::Display for Alignment {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.as_nonzero(), f)
}
}

#[unstable(feature = "ptr_alignment_type", issue = "102070")]
impl fmt::Binary for Alignment {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -230,25 +223,6 @@ impl Alignment {
}
}

#[unstable(feature = "ptr_alignment_type", issue = "102070")]
impl fmt::LowerExp for Alignment {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut buf = [0; 6];

// SAFETY: We generate an ASCII string, which is valid UTF-8.
f.pad(unsafe { str::from_utf8_unchecked(self.fmt_exp(&mut buf, b'p')) })
}
}

#[unstable(feature = "ptr_alignment_type", issue = "102070")]
impl fmt::UpperExp for Alignment {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut buf = [0; 6];
// SAFETY: We generate an ASCII string, which is valid UTF-8.
f.pad(unsafe { str::from_utf8_unchecked(self.fmt_exp(&mut buf, b'P')) })
}
}

#[unstable(feature = "ptr_alignment_type", issue = "102070")]
impl TryFrom<NonZeroUsize> for Alignment {
type Error = num::TryFromIntError;
Expand Down

0 comments on commit 6651cb6

Please sign in to comment.