diff --git a/examples/intrinsics.rs b/examples/intrinsics.rs index e13c0fb1..ad000947 100644 --- a/examples/intrinsics.rs +++ b/examples/intrinsics.rs @@ -5,17 +5,18 @@ #![allow(unused_features)] #![allow(internal_features)] -#![cfg_attr(thumb, no_main)] #![deny(dead_code)] #![feature(allocator_api)] #![feature(f128)] #![feature(f16)] #![feature(lang_items)] -#![feature(start)] #![no_std] +#![no_main] extern crate panic_handler; +use core::ffi::c_int; + #[cfg(all(not(thumb), not(windows), not(target_arch = "wasm32")))] #[link(name = "c")] extern "C" {} @@ -630,11 +631,10 @@ fn run() { extern "C" { fn rust_begin_unwind(x: usize); } - // if bb(false) { + unsafe { rust_begin_unwind(0); } - // } } fn something_with_a_dtor(f: &dyn Fn()) { @@ -649,15 +649,15 @@ fn something_with_a_dtor(f: &dyn Fn()) { f(); } +#[no_mangle] #[cfg(not(thumb))] -#[start] -fn main(_: isize, _: *const *const u8) -> isize { +fn main(_argc: c_int, _argv: *const *const u8) -> c_int { run(); 0 } -#[cfg(thumb)] #[no_mangle] +#[cfg(thumb)] pub fn _start() -> ! { run(); loop {}