Skip to content

Commit 44ac940

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 44ac940

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

examples/intrinsics.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
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

@@ -630,11 +629,10 @@ fn run() {
630629
extern "C" {
631630
fn rust_begin_unwind(x: usize);
632631
}
633-
// if bb(false) {
632+
634633
unsafe {
635634
rust_begin_unwind(0);
636635
}
637-
// }
638636
}
639637

640638
fn something_with_a_dtor(f: &dyn Fn()) {
@@ -649,15 +647,15 @@ fn something_with_a_dtor(f: &dyn Fn()) {
649647
f();
650648
}
651649

650+
#[no_mangle]
652651
#[cfg(not(thumb))]
653-
#[start]
654-
fn main(_: isize, _: *const *const u8) -> isize {
652+
fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
655653
run();
656654
0
657655
}
658656

659-
#[cfg(thumb)]
660657
#[no_mangle]
658+
#[cfg(thumb)]
661659
pub fn _start() -> ! {
662660
run();
663661
loop {}

0 commit comments

Comments
 (0)