| 1 |
#![feature(lang_items, start)] |
| 2 |
#![no_std] |
| 3 |
|
| 4 |
#[start] |
| 5 |
#[cfg(not(feature = "std"))] |
| 6 |
fn start(_argc: isize, _argv: *const *const u8) -> isize { |
| 7 |
0 |
| 8 |
} |
| 9 |
|
| 10 |
#[lang = "eh_personality"] |
| 11 |
#[no_mangle] |
| 12 |
#[cfg(not(feature = "std"))] |
| 13 |
pub extern "C" fn rust_eh_personality() {} |
| 14 |
|
| 15 |
#[panic_handler] |
| 16 |
#[cfg(not(feature = "std"))] |
| 17 |
fn panic(_info: &core::panic::PanicInfo) -> ! { |
| 18 |
unsafe { |
| 19 |
libc::abort(); |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
#[cfg(feature = "std")] |
| 24 |
fn main() {} |
| 25 |
|
| 26 |
use displaydoc::Display; |
| 27 |
|
| 28 |
/// this type is pretty swell |
| 29 |
#[derive(Display)] |
| 30 |
struct FakeType; |
| 31 |
|
| 32 |
static_assertions::assert_impl_all!(FakeType: core::fmt::Display); |