Correct the test.
This commit is contained in:
parent
4e3d1fee51
commit
f741f2cc71
@ -1,8 +0,0 @@
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
use std::intrinsics;
|
||||
|
||||
fn main() {
|
||||
unsafe { intrinsics::forget(); } //~ ERROR this function takes 1 argument but 0 arguments were supplied
|
||||
unsafe { intrinsics::forget(1, 2); } //~ ERROR this function takes 1 argument but 2 arguments were supplied
|
||||
}
|
12
tests/compile-fail/check_arg_count_too_few_args.rs
Normal file
12
tests/compile-fail/check_arg_count_too_few_args.rs
Normal file
@ -0,0 +1,12 @@
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
fn main() {
|
||||
extern "C" {
|
||||
fn malloc() -> *mut std::ffi::c_void;
|
||||
}
|
||||
|
||||
unsafe {
|
||||
let _ = malloc(); //~ ERROR Undefined Behavior: incorrect number of arguments: got 0, expected 1
|
||||
};
|
||||
}
|
12
tests/compile-fail/check_arg_count_too_many_args.rs
Normal file
12
tests/compile-fail/check_arg_count_too_many_args.rs
Normal file
@ -0,0 +1,12 @@
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
fn main() {
|
||||
extern "C" {
|
||||
fn malloc(_: i32, _: i32) -> *mut std::ffi::c_void;
|
||||
}
|
||||
|
||||
unsafe {
|
||||
let _ = malloc(1, 2); //~ ERROR Undefined Behavior: incorrect number of arguments: got 2, expected 1
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user