diff options
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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<T, A: Allocator> ops::DerefMut for Vec<T, A> { } } +#[cfg(not(no_global_oom_handling))] trait SpecCloneFrom { fn clone_from(this: &mut Self, other: &Self); } +#[cfg(not(no_global_oom_handling))] impl<T: Clone, A: Allocator> SpecCloneFrom for Vec<T, A> { default fn clone_from(this: &mut Self, other: &Self) { // drop anything that will not be overwritten @@ -2397,6 +2399,7 @@ impl<T: Clone, A: Allocator> SpecCloneFrom for Vec<T, A> { } } +#[cfg(not(no_global_oom_handling))] impl<T: Copy, A: Allocator> SpecCloneFrom for Vec<T, A> { fn clone_from(this: &mut Self, other: &Self) { this.clear(); |
