2022-12-23 18:54:14 +00:00
|
|
|
// check-fail
|
|
|
|
// revisions: missing_all_args missing_sigpipe_arg missing_ret start_ret too_many_args
|
|
|
|
// revisions: main_ty main_args main_ret argc argv_inner_ptr argv sigpipe
|
|
|
|
|
|
|
|
#![feature(lang_items, no_core)]
|
|
|
|
#![no_core]
|
|
|
|
|
|
|
|
#[lang = "copy"]
|
|
|
|
pub trait Copy {}
|
|
|
|
#[lang = "sized"]
|
|
|
|
pub trait Sized {}
|
|
|
|
|
|
|
|
#[cfg(missing_all_args)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>() -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[missing_all_args]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(missing_sigpipe_arg)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[missing_sigpipe_arg]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(missing_ret)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) {}
|
2023-09-17 18:13:05 +00:00
|
|
|
//[missing_ret]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
|
|
|
|
#[cfg(start_ret)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> u8 {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[start_ret]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(too_many_args)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(
|
2023-09-17 18:13:05 +00:00
|
|
|
//[too_many_args]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
_main: fn() -> T,
|
|
|
|
_argc: isize,
|
|
|
|
_argv: *const *const u8,
|
|
|
|
_sigpipe: u8,
|
|
|
|
_extra_arg: (),
|
|
|
|
) -> isize {
|
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(main_ty)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: u64, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[main_ty]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(main_args)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn(i32) -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[main_args]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(main_ret)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> u16, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[main_ret]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(argc)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> T, _argc: i8, _argv: *const *const u8, _sigpipe: u8) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[argc]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(argv_inner_ptr)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const usize, _sigpipe: u8) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[argv_inner_ptr]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(argv)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> T, _argc: isize, _argv: u8, _sigpipe: u8) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[argv]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(sigpipe)]
|
|
|
|
#[lang = "start"]
|
|
|
|
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: i64) -> isize {
|
2023-09-17 18:13:05 +00:00
|
|
|
//[sigpipe]~^ ERROR lang item `start` function has wrong type [E0308]
|
2022-12-23 18:54:14 +00:00
|
|
|
100
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|