Skip to content

Commit

Permalink
Remove deprecated FromBytes::(mut_)slice_from items
Browse files Browse the repository at this point in the history
These are causing PMEs in the presence of `-C link-dead-code`,
which casues them to be monomorphized for `Self = ()`, thus
producing the problematic ZSTy DST `[()]`.

Ref rust-lang/rust#131793
Fixes #1867
  • Loading branch information
jswrenn committed Oct 16, 2024
1 parent c5fb5aa commit 099bc04
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4544,17 +4544,6 @@ pub unsafe trait FromBytes: FromZeros {
Self::mut_from_bytes(source).ok()
}

#[deprecated(since = "0.8.0", note = "`FromBytes::ref_from_bytes` now supports slices")]
#[doc(hidden)]
#[must_use = "has no side effects"]
#[inline(always)]
fn slice_from(source: &[u8]) -> Option<&[Self]>
where
Self: Sized + Immutable,
{
<[Self]>::ref_from_bytes(source).ok()
}

#[deprecated(since = "0.8.0", note = "renamed to `FromBytes::ref_from_prefix_with_elems`")]
#[doc(hidden)]
#[must_use = "has no side effects"]
Expand All @@ -4577,17 +4566,6 @@ pub unsafe trait FromBytes: FromZeros {
<[Self]>::ref_from_suffix_with_elems(source, count).ok()
}

#[deprecated(since = "0.8.0", note = "`FromBytes::mut_from_bytes` now supports slices")]
#[must_use = "has no side effects"]
#[doc(hidden)]
#[inline(always)]
fn mut_slice_from(source: &mut [u8]) -> Option<&mut [Self]>
where
Self: Sized + IntoBytes,
{
<[Self]>::mut_from_bytes(source).ok()
}

#[deprecated(since = "0.8.0", note = "renamed to `FromBytes::mut_from_prefix_with_elems`")]
#[doc(hidden)]
#[must_use = "has no side effects"]
Expand Down

0 comments on commit 099bc04

Please sign in to comment.