Skip to content

Commit f741f2c

Browse files
committed
Correct the test.
1 parent 4e3d1fe commit f741f2c

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

tests/compile-fail/check_arg_count.rs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(core_intrinsics)]
2+
#![feature(rustc_private)]
3+
4+
fn main() {
5+
extern "C" {
6+
fn malloc() -> *mut std::ffi::c_void;
7+
}
8+
9+
unsafe {
10+
let _ = malloc(); //~ ERROR Undefined Behavior: incorrect number of arguments: got 0, expected 1
11+
};
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(core_intrinsics)]
2+
#![feature(rustc_private)]
3+
4+
fn main() {
5+
extern "C" {
6+
fn malloc(_: i32, _: i32) -> *mut std::ffi::c_void;
7+
}
8+
9+
unsafe {
10+
let _ = malloc(1, 2); //~ ERROR Undefined Behavior: incorrect number of arguments: got 2, expected 1
11+
};
12+
}

0 commit comments

Comments
 (0)