#![no_main] #![no_std] extern crate libc; mod c; #[no_mangle] pub extern fn main(_nargs: libc::c_int, _args: *const *const libc::c_char) -> libc::c_int { let foo = cstr!("Foo! %p\n"); let x = c::string::CBox::new(()); unsafe { libc::printf(foo.as_ptr(), &*x as *const ()); } 0 } #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { unsafe { libc::abort() } }