Skip to content

Commit f4545cc

Browse files
committed
Mark __rgl_oom and __rd_oom as "C-unwind"
1 parent 622a394 commit f4545cc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

library/alloc/src/alloc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,13 @@ pub mod __alloc_error_handler {
383383

384384
// if there is no `#[alloc_error_handler]`
385385
#[rustc_std_internal_symbol]
386-
pub unsafe extern "C" fn __rdl_oom(size: usize, _align: usize) -> ! {
386+
pub unsafe extern "C-unwind" fn __rdl_oom(size: usize, _align: usize) -> ! {
387387
panic!("memory allocation of {} bytes failed", size)
388388
}
389389

390390
// if there is an `#[alloc_error_handler]`
391391
#[rustc_std_internal_symbol]
392-
pub unsafe extern "C" fn __rg_oom(size: usize, align: usize) -> ! {
392+
pub unsafe extern "C-unwind" fn __rg_oom(size: usize, align: usize) -> ! {
393393
let layout = unsafe { Layout::from_size_align_unchecked(size, align) };
394394
extern "Rust" {
395395
#[lang = "oom"]

library/alloc/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
#![cfg_attr(test, feature(test))]
153153
#![feature(unboxed_closures)]
154154
#![feature(unsized_fn_params)]
155+
#![feature(c_unwind)]
155156
//
156157
// Rustdoc features:
157158
#![feature(doc_cfg)]

0 commit comments

Comments
 (0)