diff --git a/tests/compile-fail/unsupported_get_process_heap.rs b/tests/compile-fail/unsupported_get_process_heap.rs deleted file mode 100644 index 4fd5f4b7d885..000000000000 --- a/tests/compile-fail/unsupported_get_process_heap.rs +++ /dev/null @@ -1,12 +0,0 @@ -//! `GetProcessHeap()` is special on Windows that it's only supported within libstd. -//! (On Linux and macOS, it's just always unsupported.) - -fn main() { - extern "system" { - fn GetProcessHeap() -> *mut std::ffi::c_void; - } - unsafe { - GetProcessHeap(); - //~^ ERROR unsupported operation: can't call foreign function: GetProcessHeap - } -} diff --git a/tests/run-pass/std_only_foreign_function.rs b/tests/run-pass/std_only_foreign_function.rs deleted file mode 100644 index 959103ee5c8e..000000000000 --- a/tests/run-pass/std_only_foreign_function.rs +++ /dev/null @@ -1,39 +0,0 @@ -//! Make sure we can call foreign functions that are only allowed within libstd if we are "libstd" -//! (defining the `start` lang item). -#![feature(lang_items, rustc_private, core_intrinsics)] -#![no_std] - -use core::{intrinsics, panic::PanicInfo}; - -#[lang = "eh_personality"] -fn rust_eh_personality() {} - -#[panic_handler] -fn panic_handler(_: &PanicInfo<'_>) -> ! { - intrinsics::abort() -} - -#[lang = "start"] -fn start(main: fn(), _argc: isize, _argv: *const *const u8) -> isize { - main(); - 0 -} - -fn main() { - #[cfg(unix)] - unsafe { - extern crate libc; - assert_eq!(libc::signal(libc::SIGPIPE, libc::SIG_IGN), 0); - } - #[cfg(windows)] - unsafe { - extern "system" { - fn GetProcessHeap() -> *mut core::ffi::c_void; - fn ExitProcess(code: u32) -> !; - } - assert_eq!(GetProcessHeap() as usize, 1); - // Early exit to avoid the requirement of - // `std::sys::windows::thread_local_key::p_thread_callback`. - ExitProcess(0); - } -}