Thanks for the info about panic_fmt
. I'm still only able to build on nightly
due to:
error: language item required, but not found: `eh_personality`
The following does work on nightly
though:
#![feature(lang_items)]
#![no_std]
#![no_main]
extern crate libc;
#[no_mangle]
pub extern "C" fn main(_argc: isize, _argv: *const *const u8) -> isize {
// Since we are passing a C string the final null character is mandatory
const HELLO: &'static str = "Hello, world!\n\0";
unsafe {
libc::printf(HELLO.as_ptr() as *const _);
}
0
}
#[panic_handler]
fn my_panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
#[lang = "eh_personality"]
extern "C" fn eh_personality() {}
Unless someone knows about how to work around this lang item on stable
?