From be5a5b70b48ce6d9111bea36a11c9c8827960251 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Fri, 17 Sep 2021 03:52:14 +0100 Subject: [PATCH] Fix missing `no_global_oom_handling` cfg-gating --- library/alloc/src/boxed.rs | 2 ++ library/alloc/src/vec/mod.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 72216852376..2b3a18a439f 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -1086,6 +1086,7 @@ fn drop(&mut self) { } } +#[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] impl Default for Box { /// Creates a `Box`, with the `Default` value for T. @@ -1394,6 +1395,7 @@ fn from(s: Box) -> Self { } } +#[cfg(not(no_global_oom_handling))] #[stable(feature = "box_from_array", since = "1.45.0")] impl From<[T; N]> for Box<[T]> { /// Converts a `[T; N]` into a `Box<[T]>` diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 87a0d371815..2f6887229e7 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2841,6 +2841,7 @@ fn from(s: &mut [T]) -> Vec { } } +#[cfg(not(no_global_oom_handling))] #[stable(feature = "vec_from_array", since = "1.44.0")] impl From<[T; N]> for Vec { #[cfg(not(test))]