diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index e5d62447eb20e..2f5a4beaea2fd 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -183,6 +183,9 @@ use crate::vec::Vec; #[unstable(feature = "thin_box", issue = "92791")] pub use thin::ThinBox; +#[cfg(not(no_global_oom_handling))] +use crate::sync::Arc; + mod thin; /// A pointer type that uniquely owns a heap allocation of type `T`. @@ -1284,6 +1287,15 @@ impl Default for Box { } } +#[cfg(not(no_global_oom_handling))] +#[stable(feature = "rust1", since = "1.0.0")] +impl Default for Arc { + #[inline] + fn default() -> Self { + Arc::from("") + } +} + #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] impl Clone for Box {