Correct the test.

This commit is contained in:
Chase Albert 2020-05-04 23:22:00 -04:00
parent 4e3d1fee51
commit f741f2cc71
3 changed files with 24 additions and 8 deletions

View File

@ -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
}

View 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
};
}

View 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
};
}