Add regression test for #92157

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
Yuki Okushi 2023-01-15 05:47:24 +09:00
parent 4b51adf6ff
commit aa51a0f19a
No known key found for this signature in database
2 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,40 @@
#![feature(no_core)]
#![feature(lang_items)]
#![no_core]
#[cfg(target_os = "linux")]
#[link(name = "c")]
extern {}
#[lang = "start"]
fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {
//~^ ERROR: incorrect number of parameters for the `start` lang item
40+2
}
#[lang = "sized"]
pub trait Sized {}
#[lang = "copy"]
pub trait Copy {}
#[lang = "drop_in_place"]
#[allow(unconditional_recursion)]
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
drop_in_place(to_drop)
}
#[lang = "add"]
trait Add<RHS> {
type Output;
fn add(self, other: RHS) -> Self::Output;
}
impl Add<isize> for isize {
type Output = isize;
fn add(self, other: isize) -> isize {
self + other
}
}
fn main() {}

View file

@ -0,0 +1,11 @@
error: incorrect number of parameters for the `start` lang item
--> $DIR/issue-92157.rs:11:1
|
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `start` lang item should have four parameters, but found 3
= note: the `start` lang item should have the signature `fn(fn() -> T, isize, *const *const u8, u8) -> isize`
error: aborting due to previous error