Add missing cfg attribute
This commit is contained in:
parent
361398009b
commit
94d6b22fc3
1 changed files with 3 additions and 0 deletions
|
@ -2378,10 +2378,12 @@ impl<T, A: Allocator> ops::DerefMut for Vec<T, A> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(no_global_oom_handling))]
|
||||||
trait SpecCloneFrom {
|
trait SpecCloneFrom {
|
||||||
fn clone_from(this: &mut Self, other: &Self);
|
fn clone_from(this: &mut Self, other: &Self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(no_global_oom_handling))]
|
||||||
impl<T: Clone, A: Allocator> SpecCloneFrom for Vec<T, A> {
|
impl<T: Clone, A: Allocator> SpecCloneFrom for Vec<T, A> {
|
||||||
default fn clone_from(this: &mut Self, other: &Self) {
|
default fn clone_from(this: &mut Self, other: &Self) {
|
||||||
// drop anything that will not be overwritten
|
// 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> {
|
impl<T: Copy, A: Allocator> SpecCloneFrom for Vec<T, A> {
|
||||||
fn clone_from(this: &mut Self, other: &Self) {
|
fn clone_from(this: &mut Self, other: &Self) {
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue