Rollup merge of #77315 - exrook:rename-allocerror, r=joshtriplett

Rename AllocErr to AllocError

Implements rust-lang/wg-allocators#57
This commit is contained in:
Dylan DPC 2020-10-01 02:13:39 +02:00 committed by GitHub
commit 70740b1b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 43 additions and 43 deletions

View File

@ -145,13 +145,13 @@ pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 {
impl Global { impl Global {
#[inline] #[inline]
fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocErr> { fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocError> {
match layout.size() { match layout.size() {
0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)), 0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)),
// SAFETY: `layout` is non-zero in size, // SAFETY: `layout` is non-zero in size,
size => unsafe { size => unsafe {
let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) }; let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) };
let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?; let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?;
Ok(NonNull::slice_from_raw_parts(ptr, size)) Ok(NonNull::slice_from_raw_parts(ptr, size))
}, },
} }
@ -165,7 +165,7 @@ impl Global {
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
zeroed: bool, zeroed: bool,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
debug_assert!( debug_assert!(
new_layout.size() >= old_layout.size(), new_layout.size() >= old_layout.size(),
"`new_layout.size()` must be greater than or equal to `old_layout.size()`" "`new_layout.size()` must be greater than or equal to `old_layout.size()`"
@ -183,7 +183,7 @@ impl Global {
intrinsics::assume(new_size >= old_layout.size()); intrinsics::assume(new_size >= old_layout.size());
let raw_ptr = realloc(ptr.as_ptr(), old_layout, new_size); let raw_ptr = realloc(ptr.as_ptr(), old_layout, new_size);
let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?; let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?;
if zeroed { if zeroed {
raw_ptr.add(old_size).write_bytes(0, new_size - old_size); raw_ptr.add(old_size).write_bytes(0, new_size - old_size);
} }
@ -208,12 +208,12 @@ impl Global {
#[unstable(feature = "allocator_api", issue = "32838")] #[unstable(feature = "allocator_api", issue = "32838")]
unsafe impl AllocRef for Global { unsafe impl AllocRef for Global {
#[inline] #[inline]
fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
self.alloc_impl(layout, false) self.alloc_impl(layout, false)
} }
#[inline] #[inline]
fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
self.alloc_impl(layout, true) self.alloc_impl(layout, true)
} }
@ -232,7 +232,7 @@ unsafe impl AllocRef for Global {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
// SAFETY: all conditions must be upheld by the caller // SAFETY: all conditions must be upheld by the caller
unsafe { self.grow_impl(ptr, old_layout, new_layout, false) } unsafe { self.grow_impl(ptr, old_layout, new_layout, false) }
} }
@ -243,7 +243,7 @@ unsafe impl AllocRef for Global {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
// SAFETY: all conditions must be upheld by the caller // SAFETY: all conditions must be upheld by the caller
unsafe { self.grow_impl(ptr, old_layout, new_layout, true) } unsafe { self.grow_impl(ptr, old_layout, new_layout, true) }
} }
@ -254,7 +254,7 @@ unsafe impl AllocRef for Global {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
debug_assert!( debug_assert!(
new_layout.size() <= old_layout.size(), new_layout.size() <= old_layout.size(),
"`new_layout.size()` must be smaller than or equal to `old_layout.size()`" "`new_layout.size()` must be smaller than or equal to `old_layout.size()`"
@ -273,7 +273,7 @@ unsafe impl AllocRef for Global {
intrinsics::assume(new_size <= old_layout.size()); intrinsics::assume(new_size <= old_layout.size());
let raw_ptr = realloc(ptr.as_ptr(), old_layout, new_size); let raw_ptr = realloc(ptr.as_ptr(), old_layout, new_size);
let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?; let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?;
Ok(NonNull::slice_from_raw_parts(ptr, new_size)) Ok(NonNull::slice_from_raw_parts(ptr, new_size))
}, },

View File

@ -3,7 +3,7 @@ use std::cell::Cell;
#[test] #[test]
fn allocator_param() { fn allocator_param() {
use crate::alloc::AllocErr; use crate::alloc::AllocError;
// Writing a test of integration between third-party // Writing a test of integration between third-party
// allocators and `RawVec` is a little tricky because the `RawVec` // allocators and `RawVec` is a little tricky because the `RawVec`
@ -21,10 +21,10 @@ fn allocator_param() {
fuel: Cell<usize>, fuel: Cell<usize>,
} }
unsafe impl AllocRef for BoundedAlloc { unsafe impl AllocRef for BoundedAlloc {
fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
let size = layout.size(); let size = layout.size();
if size > self.fuel.get() { if size > self.fuel.get() {
return Err(AllocErr); return Err(AllocError);
} }
match Global.alloc(layout) { match Global.alloc(layout) {
ok @ Ok(_) => { ok @ Ok(_) => {

View File

@ -247,7 +247,7 @@ use core::pin::Pin;
use core::ptr::{self, NonNull}; use core::ptr::{self, NonNull};
use core::slice::from_raw_parts_mut; use core::slice::from_raw_parts_mut;
use crate::alloc::{box_free, handle_alloc_error, AllocErr, AllocRef, Global, Layout}; use crate::alloc::{box_free, handle_alloc_error, AllocError, AllocRef, Global, Layout};
use crate::borrow::{Cow, ToOwned}; use crate::borrow::{Cow, ToOwned};
use crate::string::String; use crate::string::String;
use crate::vec::Vec; use crate::vec::Vec;
@ -996,7 +996,7 @@ impl<T: ?Sized> Rc<T> {
/// and must return back a (potentially fat)-pointer for the `RcBox<T>`. /// and must return back a (potentially fat)-pointer for the `RcBox<T>`.
unsafe fn allocate_for_layout( unsafe fn allocate_for_layout(
value_layout: Layout, value_layout: Layout,
allocate: impl FnOnce(Layout) -> Result<NonNull<[u8]>, AllocErr>, allocate: impl FnOnce(Layout) -> Result<NonNull<[u8]>, AllocError>,
mem_to_rcbox: impl FnOnce(*mut u8) -> *mut RcBox<T>, mem_to_rcbox: impl FnOnce(*mut u8) -> *mut RcBox<T>,
) -> *mut RcBox<T> { ) -> *mut RcBox<T> {
// Calculate layout using the given value layout. // Calculate layout using the given value layout.

View File

@ -21,7 +21,7 @@ use core::slice::from_raw_parts_mut;
use core::sync::atomic; use core::sync::atomic;
use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst}; use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
use crate::alloc::{box_free, handle_alloc_error, AllocErr, AllocRef, Global, Layout}; use crate::alloc::{box_free, handle_alloc_error, AllocError, AllocRef, Global, Layout};
use crate::borrow::{Cow, ToOwned}; use crate::borrow::{Cow, ToOwned};
use crate::boxed::Box; use crate::boxed::Box;
use crate::rc::is_dangling; use crate::rc::is_dangling;
@ -969,7 +969,7 @@ impl<T: ?Sized> Arc<T> {
/// and must return back a (potentially fat)-pointer for the `ArcInner<T>`. /// and must return back a (potentially fat)-pointer for the `ArcInner<T>`.
unsafe fn allocate_for_layout( unsafe fn allocate_for_layout(
value_layout: Layout, value_layout: Layout,
allocate: impl FnOnce(Layout) -> Result<NonNull<[u8]>, AllocErr>, allocate: impl FnOnce(Layout) -> Result<NonNull<[u8]>, AllocError>,
mem_to_arcinner: impl FnOnce(*mut u8) -> *mut ArcInner<T>, mem_to_arcinner: impl FnOnce(*mut u8) -> *mut ArcInner<T>,
) -> *mut ArcInner<T> { ) -> *mut ArcInner<T> {
// Calculate layout using the given value layout. // Calculate layout using the given value layout.

View File

@ -13,17 +13,17 @@ pub use self::layout::{Layout, LayoutErr};
use crate::fmt; use crate::fmt;
use crate::ptr::{self, NonNull}; use crate::ptr::{self, NonNull};
/// The `AllocErr` error indicates an allocation failure /// The `AllocError` error indicates an allocation failure
/// that may be due to resource exhaustion or to /// that may be due to resource exhaustion or to
/// something wrong when combining the given input arguments with this /// something wrong when combining the given input arguments with this
/// allocator. /// allocator.
#[unstable(feature = "allocator_api", issue = "32838")] #[unstable(feature = "allocator_api", issue = "32838")]
#[derive(Copy, Clone, PartialEq, Eq, Debug)] #[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct AllocErr; pub struct AllocError;
// (we need this for downstream impl of trait Error) // (we need this for downstream impl of trait Error)
#[unstable(feature = "allocator_api", issue = "32838")] #[unstable(feature = "allocator_api", issue = "32838")]
impl fmt::Display for AllocErr { impl fmt::Display for AllocError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("memory allocation failed") f.write_str("memory allocation failed")
} }
@ -109,7 +109,7 @@ pub unsafe trait AllocRef {
/// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar. /// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.
/// ///
/// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr>; fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>;
/// Behaves like `alloc`, but also ensures that the returned memory is zero-initialized. /// Behaves like `alloc`, but also ensures that the returned memory is zero-initialized.
/// ///
@ -126,7 +126,7 @@ pub unsafe trait AllocRef {
/// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar. /// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar.
/// ///
/// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
let ptr = self.alloc(layout)?; let ptr = self.alloc(layout)?;
// SAFETY: `alloc` returns a valid memory block // SAFETY: `alloc` returns a valid memory block
unsafe { ptr.as_non_null_ptr().as_ptr().write_bytes(0, ptr.len()) } unsafe { ptr.as_non_null_ptr().as_ptr().write_bytes(0, ptr.len()) }
@ -187,7 +187,7 @@ pub unsafe trait AllocRef {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
debug_assert!( debug_assert!(
new_layout.size() >= old_layout.size(), new_layout.size() >= old_layout.size(),
"`new_layout.size()` must be greater than or equal to `old_layout.size()`" "`new_layout.size()` must be greater than or equal to `old_layout.size()`"
@ -248,7 +248,7 @@ pub unsafe trait AllocRef {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
debug_assert!( debug_assert!(
new_layout.size() >= old_layout.size(), new_layout.size() >= old_layout.size(),
"`new_layout.size()` must be greater than or equal to `old_layout.size()`" "`new_layout.size()` must be greater than or equal to `old_layout.size()`"
@ -312,7 +312,7 @@ pub unsafe trait AllocRef {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
debug_assert!( debug_assert!(
new_layout.size() <= old_layout.size(), new_layout.size() <= old_layout.size(),
"`new_layout.size()` must be smaller than or equal to `old_layout.size()`" "`new_layout.size()` must be smaller than or equal to `old_layout.size()`"
@ -348,12 +348,12 @@ where
A: AllocRef + ?Sized, A: AllocRef + ?Sized,
{ {
#[inline] #[inline]
fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
(**self).alloc(layout) (**self).alloc(layout)
} }
#[inline] #[inline]
fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
(**self).alloc_zeroed(layout) (**self).alloc_zeroed(layout)
} }
@ -369,7 +369,7 @@ where
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
// SAFETY: the safety contract must be upheld by the caller // SAFETY: the safety contract must be upheld by the caller
unsafe { (**self).grow(ptr, old_layout, new_layout) } unsafe { (**self).grow(ptr, old_layout, new_layout) }
} }
@ -380,7 +380,7 @@ where
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
// SAFETY: the safety contract must be upheld by the caller // SAFETY: the safety contract must be upheld by the caller
unsafe { (**self).grow_zeroed(ptr, old_layout, new_layout) } unsafe { (**self).grow_zeroed(ptr, old_layout, new_layout) }
} }
@ -391,7 +391,7 @@ where
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
// SAFETY: the safety contract must be upheld by the caller // SAFETY: the safety contract must be upheld by the caller
unsafe { (**self).shrink(ptr, old_layout, new_layout) } unsafe { (**self).shrink(ptr, old_layout, new_layout) }
} }

View File

@ -448,7 +448,7 @@ impl<T> NonNull<[T]> {
/// // Note that calling `memory.as_mut()` is not allowed here as the content may be uninitialized. /// // Note that calling `memory.as_mut()` is not allowed here as the content may be uninitialized.
/// # #[allow(unused_variables)] /// # #[allow(unused_variables)]
/// let slice: &mut [MaybeUninit<u8>] = unsafe { memory.as_uninit_slice_mut() }; /// let slice: &mut [MaybeUninit<u8>] = unsafe { memory.as_uninit_slice_mut() };
/// # Ok::<_, std::alloc::AllocErr>(()) /// # Ok::<_, std::alloc::AllocError>(())
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "ptr_as_uninit", issue = "75402")] #[unstable(feature = "ptr_as_uninit", issue = "75402")]

View File

@ -133,7 +133,7 @@ pub struct System;
impl System { impl System {
#[inline] #[inline]
fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocErr> { fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocError> {
match layout.size() { match layout.size() {
0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)), 0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)),
// SAFETY: `layout` is non-zero in size, // SAFETY: `layout` is non-zero in size,
@ -143,7 +143,7 @@ impl System {
} else { } else {
GlobalAlloc::alloc(self, layout) GlobalAlloc::alloc(self, layout)
}; };
let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?; let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?;
Ok(NonNull::slice_from_raw_parts(ptr, size)) Ok(NonNull::slice_from_raw_parts(ptr, size))
}, },
} }
@ -157,7 +157,7 @@ impl System {
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
zeroed: bool, zeroed: bool,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
debug_assert!( debug_assert!(
new_layout.size() >= old_layout.size(), new_layout.size() >= old_layout.size(),
"`new_layout.size()` must be greater than or equal to `old_layout.size()`" "`new_layout.size()` must be greater than or equal to `old_layout.size()`"
@ -175,7 +175,7 @@ impl System {
intrinsics::assume(new_size >= old_layout.size()); intrinsics::assume(new_size >= old_layout.size());
let raw_ptr = GlobalAlloc::realloc(self, ptr.as_ptr(), old_layout, new_size); let raw_ptr = GlobalAlloc::realloc(self, ptr.as_ptr(), old_layout, new_size);
let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?; let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?;
if zeroed { if zeroed {
raw_ptr.add(old_size).write_bytes(0, new_size - old_size); raw_ptr.add(old_size).write_bytes(0, new_size - old_size);
} }
@ -202,12 +202,12 @@ impl System {
#[unstable(feature = "allocator_api", issue = "32838")] #[unstable(feature = "allocator_api", issue = "32838")]
unsafe impl AllocRef for System { unsafe impl AllocRef for System {
#[inline] #[inline]
fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
self.alloc_impl(layout, false) self.alloc_impl(layout, false)
} }
#[inline] #[inline]
fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
self.alloc_impl(layout, true) self.alloc_impl(layout, true)
} }
@ -226,7 +226,7 @@ unsafe impl AllocRef for System {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
// SAFETY: all conditions must be upheld by the caller // SAFETY: all conditions must be upheld by the caller
unsafe { self.grow_impl(ptr, old_layout, new_layout, false) } unsafe { self.grow_impl(ptr, old_layout, new_layout, false) }
} }
@ -237,7 +237,7 @@ unsafe impl AllocRef for System {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
// SAFETY: all conditions must be upheld by the caller // SAFETY: all conditions must be upheld by the caller
unsafe { self.grow_impl(ptr, old_layout, new_layout, true) } unsafe { self.grow_impl(ptr, old_layout, new_layout, true) }
} }
@ -248,7 +248,7 @@ unsafe impl AllocRef for System {
ptr: NonNull<u8>, ptr: NonNull<u8>,
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocErr> { ) -> Result<NonNull<[u8]>, AllocError> {
debug_assert!( debug_assert!(
new_layout.size() <= old_layout.size(), new_layout.size() <= old_layout.size(),
"`new_layout.size()` must be smaller than or equal to `old_layout.size()`" "`new_layout.size()` must be smaller than or equal to `old_layout.size()`"
@ -267,7 +267,7 @@ unsafe impl AllocRef for System {
intrinsics::assume(new_size <= old_layout.size()); intrinsics::assume(new_size <= old_layout.size());
let raw_ptr = GlobalAlloc::realloc(self, ptr.as_ptr(), old_layout, new_size); let raw_ptr = GlobalAlloc::realloc(self, ptr.as_ptr(), old_layout, new_size);
let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?; let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?;
Ok(NonNull::slice_from_raw_parts(ptr, new_size)) Ok(NonNull::slice_from_raw_parts(ptr, new_size))
}, },

View File

@ -19,7 +19,7 @@ mod tests;
use core::array; use core::array;
use core::convert::Infallible; use core::convert::Infallible;
use crate::alloc::{AllocErr, LayoutErr}; use crate::alloc::{AllocError, LayoutErr};
use crate::any::TypeId; use crate::any::TypeId;
use crate::backtrace::Backtrace; use crate::backtrace::Backtrace;
use crate::borrow::Cow; use crate::borrow::Cow;
@ -387,7 +387,7 @@ impl Error for ! {}
reason = "the precise API and guarantees it provides may be tweaked.", reason = "the precise API and guarantees it provides may be tweaked.",
issue = "32838" issue = "32838"
)] )]
impl Error for AllocErr {} impl Error for AllocError {}
#[stable(feature = "alloc_layout", since = "1.28.0")] #[stable(feature = "alloc_layout", since = "1.28.0")]
impl Error for LayoutErr {} impl Error for LayoutErr {}