remove support for the #[start] attribute
This commit is contained in:
parent
341f60327f
commit
56c90dc31e
176 changed files with 454 additions and 1260 deletions
|
@ -3,11 +3,12 @@
|
|||
// Run-time:
|
||||
// status: signal
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics, rustc_attrs)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics, rustc_attrs)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -49,7 +50,7 @@ fn test_fail() -> ! {
|
|||
unsafe { intrinsics::abort() };
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
test_fail();
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
// Run-time:
|
||||
// status: signal
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics, rustc_attrs)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics, rustc_attrs)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -50,8 +51,8 @@ fn fail() -> i32 {
|
|||
0
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
fail();
|
||||
0
|
||||
}
|
||||
|
|
|
@ -7,10 +7,11 @@
|
|||
// 5
|
||||
// 10
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
extern crate mini_core;
|
||||
|
||||
|
@ -28,8 +29,8 @@ fn make_array() -> [u8; 3] {
|
|||
[42, 10, 5]
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
let array = [42, 7, 5];
|
||||
let array2 = make_array();
|
||||
unsafe {
|
||||
|
|
|
@ -6,10 +6,11 @@
|
|||
// 10
|
||||
|
||||
#![allow(internal_features, unused_attributes)]
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics, rustc_attrs, track_caller)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics, rustc_attrs, track_caller)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -142,8 +143,8 @@ fn inc(num: isize) -> isize {
|
|||
}
|
||||
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
argc = inc(argc);
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, argc);
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
// Int argument: 2
|
||||
// Both args: 11
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
extern crate mini_core;
|
||||
|
||||
|
@ -22,8 +23,8 @@ mod libc {
|
|||
}
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
let string = "Arg: %d\n\0";
|
||||
let mut closure = || {
|
||||
unsafe {
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
// stdout: true
|
||||
// 1
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
extern crate mini_core;
|
||||
|
||||
|
@ -19,8 +20,8 @@ mod libc {
|
|||
}
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
unsafe {
|
||||
if argc == 1 {
|
||||
libc::printf(b"true\n\0" as *const u8 as *const i8);
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
// Run-time:
|
||||
// status: 0
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start)]
|
||||
#![feature(auto_traits, lang_items, no_core)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -34,7 +35,7 @@ pub(crate) unsafe auto trait Freeze {}
|
|||
* Code
|
||||
*/
|
||||
|
||||
#[start]
|
||||
fn main(_argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
0
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
// Run-time:
|
||||
// status: 2
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
mod libc {
|
||||
#[link(name = "c")]
|
||||
|
@ -41,8 +42,8 @@ pub(crate) unsafe auto trait Freeze {}
|
|||
* Code
|
||||
*/
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
unsafe {
|
||||
libc::exit(2);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
// Run-time:
|
||||
// status: 1
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start)]
|
||||
#![feature(auto_traits, lang_items, no_core)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -34,7 +35,7 @@ pub(crate) unsafe auto trait Freeze {}
|
|||
* Code
|
||||
*/
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
1
|
||||
}
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
// status: 0
|
||||
// stdout: 1
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
extern crate mini_core;
|
||||
|
||||
|
@ -26,8 +27,8 @@ fn call_func(func: fn(i16) -> i8, param: i16) -> i8 {
|
|||
func(param)
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
unsafe {
|
||||
let result = call_func(i16_as_i8, argc as i16) as isize;
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, result);
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
// 11
|
||||
|
||||
#![allow(internal_features, unused_attributes)]
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics, rustc_attrs, track_caller)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics, rustc_attrs, track_caller)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -148,8 +149,8 @@ fn update_num(num: &mut isize) {
|
|||
*num = *num + 5;
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
let mut test = test(argc);
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, test.field);
|
||||
|
|
|
@ -6,10 +6,11 @@
|
|||
// 10
|
||||
|
||||
#![allow(internal_features, unused_attributes)]
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics, arbitrary_self_types, rustc_attrs)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics, arbitrary_self_types, rustc_attrs)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -231,8 +232,8 @@ pub fn panic_const_mul_overflow() -> ! {
|
|||
* Code
|
||||
*/
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, 40 + argc);
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, 40 - argc);
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
// status: 0
|
||||
// stdout: 1
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
extern crate mini_core;
|
||||
|
||||
|
@ -24,8 +25,8 @@ fn make_array() -> [u8; 3] {
|
|||
[42, 10, 5]
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
unsafe {
|
||||
let ptr = ONE as *mut usize;
|
||||
let value = ptr as usize;
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
// 10
|
||||
// 42
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
#[lang = "copy"]
|
||||
pub unsafe trait Copy {}
|
||||
|
@ -61,8 +62,8 @@ fn int_cast(a: u16, b: i16) -> (u8, u16, u32, usize, i8, i16, i32, isize, u8, u3
|
|||
)
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
let (a, b, c, d, e, f, g, h, i, j) = int_cast(10, 42);
|
||||
unsafe {
|
||||
libc::printf(b"%d\n\0" as *const u8 as *const i8, c);
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
// status: 0
|
||||
// stdout: 5
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
extern crate mini_core;
|
||||
|
||||
|
@ -26,8 +27,8 @@ fn index_slice(s: &[u32]) -> u32 {
|
|||
}
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
let array = [42, 7, 5];
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, index_slice(&array));
|
||||
|
|
|
@ -9,11 +9,12 @@
|
|||
// 12
|
||||
// 1
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics, rustc_attrs)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics, rustc_attrs)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -98,8 +99,8 @@ static mut WITH_REF: WithRef = WithRef {
|
|||
refe: unsafe { &TEST },
|
||||
};
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, CONSTANT);
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, TEST2.field);
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
// stdout: 1
|
||||
// 2
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -55,8 +56,8 @@ fn one() -> isize {
|
|||
1
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
let test = Test {
|
||||
field: one(),
|
||||
};
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
// status: 0
|
||||
// stdout: 3
|
||||
|
||||
#![feature(auto_traits, lang_items, no_core, start, intrinsics)]
|
||||
#![feature(auto_traits, lang_items, no_core, intrinsics)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
/*
|
||||
* Core
|
||||
|
@ -42,8 +43,8 @@ mod libc {
|
|||
* Code
|
||||
*/
|
||||
|
||||
#[start]
|
||||
fn main(mut argc: isize, _argv: *const *const u8) -> isize {
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
let test: (isize, isize, isize) = (3, 1, 4);
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, test.0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue