]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/macros/mod.rs
Rewrite implementation of `#[alloc_error_handler]`
[rust.git] / library / core / src / macros / mod.rs
index fd96e1ff77d53cb3211707427d587f49d0ca3e52..2850d84acc3274b09f9169dc6c1b377ddd516730 100644 (file)
@@ -1511,6 +1511,17 @@ macro_rules! trace_macros {
         /* compiler built-in */
     }
 
+    /// Attribute macro applied to a function to register it as a handler for allocation failure.
+    ///
+    /// See also [`std::alloc::handle_alloc_error`](../../../std/alloc/fn.handle_alloc_error.html).
+    #[cfg(not(bootstrap))]
+    #[unstable(feature = "alloc_error_handler", issue = "51540")]
+    #[allow_internal_unstable(rustc_attrs)]
+    #[rustc_builtin_macro]
+    pub macro alloc_error_handler($item:item) {
+        /* compiler built-in */
+    }
+
     /// Keeps the item it's applied to if the passed path is accessible, and removes it otherwise.
     #[unstable(
         feature = "cfg_accessible",