Skip to content
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
13 changes: 1 addition & 12 deletions library/alloc/src/io/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,19 +1031,11 @@ pub(super) fn default_read_buf_exact<R: Read + ?Sized>(
Ok(())
}

mod sealed {
/// This trait being unreachable from outside the crate
/// prevents outside implementations of our extension traits.
/// This allows adding more trait methods in the future.
#[unstable(feature = "sealed", issue = "none")]
pub trait Sealed {}
}

/// Trait for types that can be converted from a fixed-size byte array with a specified endianness
#[unstable(feature = "read_le_be_internals", reason = "internals", issue = "none")]
// Once we can use associated consts in the types of method parameters, rewrite this to have
// `from_le_bytes` and `from_be_bytes` methods, move it to `core`, and make it public.
pub trait FromEndianBytes: sealed::Sealed + Sized {
pub impl(self) trait FromEndianBytes: Sized {
#[doc(hidden)]
fn read_le_from(r: &mut impl Read) -> Result<Self>;

Expand All @@ -1053,9 +1045,6 @@ pub trait FromEndianBytes: sealed::Sealed + Sized {

macro_rules! impl_from_endian_bytes {
($($t:ty),*$(,)?) => {$(
#[unstable(feature = "sealed", issue = "none")]
impl sealed::Sealed for $t {}

#[unstable(feature = "read_le_be_internals", reason = "internals", issue = "none")]
impl FromEndianBytes for $t {
#[inline]
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
#![feature(decl_macro)]
#![feature(dropck_eyepatch)]
#![feature(fundamental)]
#![feature(impl_restriction)]
#![feature(intrinsics)]
#![feature(lang_items)]
#![feature(min_specialization)]
Expand Down
Loading