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