Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0aa1c4a

Browse files
committed
hopefully deal with _Unwind_Resume symbols
1 parent b8bc580 commit 0aa1c4a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/ui/format-no-std.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ extern "C" fn rust_eh_personality() {
3838
loop {}
3939
}
4040

41+
/// Workaround for rustc bug: https://github.com/rust-lang/rust/issues/47493,
42+
/// https://github.com/rust-lang/rust/issues/53301.
43+
///
44+
/// It shouldn't even be possible to reach this function, thanks to panic=abort,
45+
/// but liballoc is compiled with unwinding enabled and that ends up making unreachable
46+
/// references to this.
47+
#[no_mangle]
48+
extern "C" fn _Unwind_Resume() -> ! {
49+
unreachable!("Unwinding not supported");
50+
}
51+
4152
#[no_mangle]
4253
extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
4354
let s = format!("{}", 1_isize);

0 commit comments

Comments
 (0)