diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-10-04 02:02:33 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2022-02-05 20:58:04 +0000 |
| commit | 915a16035d64f2b7e676c7e77e1bf810ea448f22 (patch) | |
| tree | 2ac0ff6e49b15f6e6d0ebad7ab9288b0cfb64d32 /library/alloc/src | |
| parent | b1b88109526c5324157d52ac8f09752710e95ec3 (diff) | |
| download | rust-915a16035d64f2b7e676c7e77e1bf810ea448f22.tar.gz rust-915a16035d64f2b7e676c7e77e1bf810ea448f22.zip | |
Mark __rgl_oom and __rd_oom as "C-unwind"
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/alloc.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/lib.rs | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs index 06ed92c6014..9d4f9af91a5 100644 --- a/library/alloc/src/alloc.rs +++ b/library/alloc/src/alloc.rs @@ -396,13 +396,13 @@ pub mod __alloc_error_handler { // if there is no `#[alloc_error_handler]` #[rustc_std_internal_symbol] - pub unsafe extern "C" fn __rdl_oom(size: usize, _align: usize) -> ! { + pub unsafe extern "C-unwind" fn __rdl_oom(size: usize, _align: usize) -> ! { panic!("memory allocation of {} bytes failed", size) } // if there is an `#[alloc_error_handler]` #[rustc_std_internal_symbol] - pub unsafe extern "C" fn __rg_oom(size: usize, align: usize) -> ! { + pub unsafe extern "C-unwind" fn __rg_oom(size: usize, align: usize) -> ! { let layout = unsafe { Layout::from_size_align_unchecked(size, align) }; extern "Rust" { #[lang = "oom"] diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index dfd3771c1d0..a07071cb6fb 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -163,6 +163,7 @@ #![cfg_attr(test, feature(test))] #![feature(unboxed_closures)] #![feature(unsized_fn_params)] +#![feature(c_unwind)] // // Rustdoc features: #![feature(doc_cfg)] |
