diff options
| author | Benoît du Garreau <bdgdlm@outlook.com> | 2021-08-12 10:48:04 +0200 |
|---|---|---|
| committer | Benoît du Garreau <bdgdlm@outlook.com> | 2021-08-12 10:48:04 +0200 |
| commit | 94d6b22fc36f50b021e47eae2a9437689ee83077 (patch) | |
| tree | ede356f572f980c0447b199463fe2719a36942e6 /library/alloc/src/vec | |
| parent | 361398009be65f9aa6ae539c2ea37fbd943cc789 (diff) | |
| download | rust-94d6b22fc36f50b021e47eae2a9437689ee83077.tar.gz rust-94d6b22fc36f50b021e47eae2a9437689ee83077.zip | |
Add missing cfg attribute
Diffstat (limited to 'library/alloc/src/vec')
| -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(); |
