diff options
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/error.rs | 8 | ||||
| -rw-r--r-- | library/std/src/lib.rs | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/library/std/src/error.rs b/library/std/src/error.rs index c3cb71a5dee..4fb94908c80 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -516,6 +516,14 @@ impl<T: Error> Error for Box<T> { } } +#[unstable(feature = "thin_box", issue = "92791")] +impl<T: ?Sized + crate::error::Error> crate::error::Error for crate::boxed::ThinBox<T> { + fn source(&self) -> Option<&(dyn crate::error::Error + 'static)> { + use core::ops::Deref; + self.deref().source() + } +} + #[stable(feature = "error_by_ref", since = "1.51.0")] impl<'a, T: Error + ?Sized> Error for &'a T { #[allow(deprecated, deprecated_in_future)] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 5ade65ad9c6..60e7c2af8e4 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -290,6 +290,7 @@ #![feature(get_mut_unchecked)] #![feature(map_try_insert)] #![feature(new_uninit)] +#![feature(thin_box)] #![feature(toowned_clone_into)] #![feature(try_reserve_kind)] #![feature(vec_into_raw_parts)] |
