about summary refs log tree commit diff
path: root/library/alloc/src/alloc.rs
diff options
context:
space:
mode:
authorr0cky <mu001999@outlook.com>2023-11-26 14:24:38 +0800
committerr0cky <mu001999@outlook.com>2023-11-28 09:02:34 +0800
commitc751bfa015ab9e99f3c7845cebf04eb543648042 (patch)
tree9a4080007ca0c4da3a75fcaf2e0cfaee4e1e04e3 /library/alloc/src/alloc.rs
parent6cf088810f66fff15d05bf7135c5f5888b7c93b4 (diff)
downloadrust-c751bfa015ab9e99f3c7845cebf04eb543648042.tar.gz
rust-c751bfa015ab9e99f3c7845cebf04eb543648042.zip
Add proper cfgs
Diffstat (limited to 'library/alloc/src/alloc.rs')
-rw-r--r--library/alloc/src/alloc.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index 2499f1053d8..1663aa84921 100644
--- a/library/alloc/src/alloc.rs
+++ b/library/alloc/src/alloc.rs
@@ -423,12 +423,14 @@ pub mod __alloc_error_handler {
     }
 }
 
+#[cfg(not(no_global_oom_handling))]
 /// Specialize clones into pre-allocated, uninitialized memory.
 /// Used by `Box::clone` and `Rc`/`Arc::make_mut`.
 pub(crate) trait WriteCloneIntoRaw: Sized {
     unsafe fn write_clone_into_raw(&self, target: *mut Self);
 }
 
+#[cfg(not(no_global_oom_handling))]
 impl<T: Clone> WriteCloneIntoRaw for T {
     #[inline]
     default unsafe fn write_clone_into_raw(&self, target: *mut Self) {
@@ -438,6 +440,7 @@ impl<T: Clone> WriteCloneIntoRaw for T {
     }
 }
 
+#[cfg(not(no_global_oom_handling))]
 impl<T: Copy> WriteCloneIntoRaw for T {
     #[inline]
     unsafe fn write_clone_into_raw(&self, target: *mut Self) {