Skip to content

Allow overwriting the panic_fmt language item #513

Closed
@mahkoh

Description

@mahkoh

If an executable uses a library that is not unwind-safe, the user has to guarantee that the executable does not unwind into the library. The only way to do this reliably is to turn unwinding into aborting. This can be done by overwriting the panic_fmt language item like this:

#[lang = "panic_fmt"]
pub extern fn rust_begin_unwind(_: &fmt::Arguments, _: &'static str, _: uint) -> ! {
    unsafe { intrinsics::abort() }
}

cc #512

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions