about summary refs log tree commit diff
path: root/src/liballoc/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc/lib.rs')
-rw-r--r--src/liballoc/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 0d8d25bff20..a947378f768 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -94,6 +94,14 @@ pub mod owned;
 pub mod arc;
 pub mod rc;
 
+/// Common OOM routine used by liballoc
+fn oom() -> ! {
+    // FIXME(#14674): This really needs to do something other than just abort
+    //                here, but any printing done must be *guaranteed* to not
+    //                allocate.
+    unsafe { core::intrinsics::abort() }
+}
+
 // FIXME(#14344): When linking liballoc with libstd, this library will be linked
 //                as an rlib (it only exists as an rlib). It turns out that an
 //                optimized standard library doesn't actually use *any* symbols