Skip to content

Commit 5ae9411

Browse files
committed
Remove use of the start feature
`#![feature(start)]` was removed in [1], but we make use of it in the intrinsics example. Replace use of this feature with `#[no_mangle]` applied to `#[main]`. We don't actually run this example so it is not a problem if this is not entirely accurate. Currently the example does not run to completion, instead invoking `rust_begin_unwind`. [1]: rust-lang/rust#134299
1 parent ee92690 commit 5ae9411

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/intrinsics.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55

66
#![allow(unused_features)]
77
#![allow(internal_features)]
8-
#![cfg_attr(thumb, no_main)]
98
#![deny(dead_code)]
109
#![feature(allocator_api)]
1110
#![feature(f128)]
1211
#![feature(f16)]
1312
#![feature(lang_items)]
14-
#![feature(start)]
1513
#![no_std]
14+
#![no_main]
1615

1716
extern crate panic_handler;
1817

18+
use core::ffi::c_int;
19+
1920
#[cfg(all(not(thumb), not(windows), not(target_arch = "wasm32")))]
2021
#[link(name = "c")]
2122
extern "C" {}
@@ -630,11 +631,10 @@ fn run() {
630631
extern "C" {
631632
fn rust_begin_unwind(x: usize);
632633
}
633-
// if bb(false) {
634+
634635
unsafe {
635636
rust_begin_unwind(0);
636637
}
637-
// }
638638
}
639639

640640
fn something_with_a_dtor(f: &dyn Fn()) {
@@ -649,15 +649,15 @@ fn something_with_a_dtor(f: &dyn Fn()) {
649649
f();
650650
}
651651

652+
#[no_mangle]
652653
#[cfg(not(thumb))]
653-
#[start]
654-
fn main(_: isize, _: *const *const u8) -> isize {
654+
fn main(_argc: c_int, _argv: *const *const u8) -> c_int {
655655
run();
656656
0
657657
}
658658

659-
#[cfg(thumb)]
660659
#[no_mangle]
660+
#[cfg(thumb)]
661661
pub fn _start() -> ! {
662662
run();
663663
loop {}

0 commit comments

Comments
 (0)