use core::array;
-use crate::alloc::{AllocErr, CannotReallocInPlace, LayoutErr};
+use crate::alloc::{AllocErr, LayoutErr};
use crate::any::TypeId;
use crate::backtrace::Backtrace;
use crate::borrow::Cow;
/// fn main() {
/// match get_super_error() {
/// Err(e) => {
- /// println!("Error: {}", e.description());
+ /// println!("Error: {}", e);
/// println!("Caused by: {}", e.source().unwrap());
/// }
/// _ => println!("No error"),
)]
impl Error for LayoutErr {}
-#[unstable(
- feature = "allocator_api",
- reason = "the precise API and guarantees it provides may be tweaked.",
- issue = "32838"
-)]
-impl Error for CannotReallocInPlace {}
-
#[stable(feature = "rust1", since = "1.0.0")]
impl Error for str::ParseBoolError {
#[allow(deprecated)]
}
}
+#[unstable(feature = "try_reserve", reason = "new API", issue = "48043")]
+impl Error for alloc::collections::TryReserveError {}
+
// Copied from `any.rs`.
impl dyn Error + 'static {
/// Returns `true` if the boxed type is the same as `T`