Skip to content

Commit 94d6b22

Browse files
committed
Add missing cfg attribute
1 parent 3613980 commit 94d6b22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/alloc/src/vec/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2378,10 +2378,12 @@ impl<T, A: Allocator> ops::DerefMut for Vec<T, A> {
23782378
}
23792379
}
23802380

2381+
#[cfg(not(no_global_oom_handling))]
23812382
trait SpecCloneFrom {
23822383
fn clone_from(this: &mut Self, other: &Self);
23832384
}
23842385

2386+
#[cfg(not(no_global_oom_handling))]
23852387
impl<T: Clone, A: Allocator> SpecCloneFrom for Vec<T, A> {
23862388
default fn clone_from(this: &mut Self, other: &Self) {
23872389
// drop anything that will not be overwritten
@@ -2397,6 +2399,7 @@ impl<T: Clone, A: Allocator> SpecCloneFrom for Vec<T, A> {
23972399
}
23982400
}
23992401

2402+
#[cfg(not(no_global_oom_handling))]
24002403
impl<T: Copy, A: Allocator> SpecCloneFrom for Vec<T, A> {
24012404
fn clone_from(this: &mut Self, other: &Self) {
24022405
this.clear();

0 commit comments

Comments
 (0)