about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2024-04-17 18:47:28 -0400
committerBen Kimock <kimockb@gmail.com>2024-05-20 11:13:10 -0400
commit8d3bc559048e47de32e32a562fe5bbea0b38f4e6 (patch)
tree03ffb3889cb53e439bdfdeb8f154d7a8b2f1ea51
parent44d679b9021f03a79133021b94e6d23e9b55b3ab (diff)
downloadrust-8d3bc559048e47de32e32a562fe5bbea0b38f4e6.tar.gz
rust-8d3bc559048e47de32e32a562fe5bbea0b38f4e6.zip
Fix up a few more tests
-rw-r--r--tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs5
-rw-r--r--tests/run-make/link-path-order/main.rs6
-rw-r--r--tests/ui/env-null-vars.rs14
-rw-r--r--tests/ui/runtime/out-of-stack.rs7
-rw-r--r--tests/ui/sanitizer/thread.rs1
5 files changed, 8 insertions, 25 deletions
diff --git a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
index 5830ef033d3..e518579b906 100644
--- a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
+++ b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
@@ -1,10 +1,7 @@
 #![crate_type = "staticlib"]
 #![feature(c_variadic)]
-#![feature(rustc_private)]
 
-extern crate libc;
-
-use libc::{c_char, c_double, c_int, c_long, c_longlong};
+use std::ffi::{c_char, c_double, c_int, c_long, c_longlong};
 use std::ffi::VaList;
 use std::ffi::{CString, CStr};
 
diff --git a/tests/run-make/link-path-order/main.rs b/tests/run-make/link-path-order/main.rs
index 8024e343d19..20a517dcda9 100644
--- a/tests/run-make/link-path-order/main.rs
+++ b/tests/run-make/link-path-order/main.rs
@@ -1,10 +1,8 @@
-#![feature(rustc_private)]
-
-extern crate libc;
+use std::ffi::c_int;
 
 #[link(name = "foo", kind = "static")]
 extern "C" {
-    fn should_return_one() -> libc::c_int;
+    fn should_return_one() -> c_int;
 }
 
 fn main() {
diff --git a/tests/ui/env-null-vars.rs b/tests/ui/env-null-vars.rs
index bb86fd353c4..24d783553d1 100644
--- a/tests/ui/env-null-vars.rs
+++ b/tests/ui/env-null-vars.rs
@@ -1,21 +1,15 @@
+// Ensure that env::vars() does not panic if environ is null.
+// Regression test for rust-lang/rust#53200
 //@ run-pass
 
-#![allow(unused_imports)]
-
-//@ ignore-windows
-
-// issue-53200
-
 #![feature(rustc_private)]
-extern crate libc;
-
-use std::env;
 
 // FIXME: more platforms?
 #[cfg(target_os = "linux")]
 fn main() {
+    extern crate libc;
     unsafe { libc::clearenv(); }
-    assert_eq!(env::vars().count(), 0);
+    assert_eq!(std::env::vars().count(), 0);
 }
 
 #[cfg(not(target_os = "linux"))]
diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs
index ab2b50b293c..a62398df8b8 100644
--- a/tests/ui/runtime/out-of-stack.rs
+++ b/tests/ui/runtime/out-of-stack.rs
@@ -8,21 +8,16 @@
 //@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
 //@ ignore-nto no stack overflow handler used (no alternate stack available)
 
-#![feature(core_intrinsics)]
 #![feature(rustc_private)]
 
 #[cfg(unix)]
 extern crate libc;
 
 use std::env;
+use std::hint::black_box;
 use std::process::Command;
 use std::thread;
 
-// Inlining to avoid llvm turning the recursive functions into tail calls,
-// which doesn't consume stack.
-#[inline(always)]
-pub fn black_box<T>(dummy: T) { std::intrinsics::black_box(dummy); }
-
 fn silent_recurse() {
     let buf = [0u8; 1000];
     black_box(buf);
diff --git a/tests/ui/sanitizer/thread.rs b/tests/ui/sanitizer/thread.rs
index 9d9ad6ee518..566774d6b1d 100644
--- a/tests/ui/sanitizer/thread.rs
+++ b/tests/ui/sanitizer/thread.rs
@@ -20,7 +20,6 @@
 //@ error-pattern: Location is heap block of size 4
 //@ error-pattern: allocated by main thread
 
-#![feature(raw_ref_op)]
 #![feature(rustc_private)]
 extern crate libc;