Эх сурвалжийг харах

Added 'oom' lang-item so downstream crates don't complain about missing 'oom' symbol

Tom Almeida 6 жил өмнө
parent
commit
7d7e3137bb
2 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 2 0
      src/fail.rs
  2. 1 1
      src/lib.rs

+ 2 - 0
src/fail.rs

@@ -30,6 +30,8 @@ tls! {
 ///
 /// The rule of thumb is that this should be called, if and only if unwinding (which allocates)
 /// will hit the same error.
+#[linkage = "weak"]
+#[lang = "oom"]
 pub fn oom() -> ! {
     // If TLS is enabled, we will use the thread-local OOM.
     #[cfg(feature = "tls")]

+ 1 - 1
src/lib.rs

@@ -15,7 +15,7 @@
 #![feature(
     allocator_api, const_fn, core_intrinsics, stmt_expr_attributes, optin_builtin_traits,
     type_ascription, thread_local, linkage, try_from, const_unsafe_cell_new, const_atomic_bool_new,
-    const_nonzero_new, const_atomic_ptr_new
+    const_nonzero_new, const_atomic_ptr_new, lang_items
 )]
 #![warn(missing_docs)]