From 94d6b22fc36f50b021e47eae2a9437689ee83077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20du=20Garreau?= Date: Thu, 12 Aug 2021 10:48:04 +0200 Subject: [PATCH] Add missing cfg attribute --- library/alloc/src/vec/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index e5441f13870..933361d812c 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2378,10 +2378,12 @@ impl ops::DerefMut for Vec { } } +#[cfg(not(no_global_oom_handling))] trait SpecCloneFrom { fn clone_from(this: &mut Self, other: &Self); } +#[cfg(not(no_global_oom_handling))] impl SpecCloneFrom for Vec { default fn clone_from(this: &mut Self, other: &Self) { // drop anything that will not be overwritten @@ -2397,6 +2399,7 @@ impl SpecCloneFrom for Vec { } } +#[cfg(not(no_global_oom_handling))] impl SpecCloneFrom for Vec { fn clone_from(this: &mut Self, other: &Self) { this.clear();