Skip to content

Commit 3b6433f

Browse files
committed
Fix up a few more tests
1 parent a6762ec commit 3b6433f

File tree

7 files changed

+13
-167
lines changed

7 files changed

+13
-167
lines changed

library/core/src/primitive_docs.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,10 @@ impl () {}
537537
/// ## 4. Get it from C.
538538
///
539539
/// ```
540-
/// # #![feature(rustc_private)]
541-
/// #[allow(unused_extern_crates)]
542-
/// extern crate libc;
540+
/// # mod libc {
541+
/// # pub unsafe fn malloc(_size: usize) -> *mut u8 { core::ptr::NonNull::dangling().as_ptr() }
542+
/// # pub unsafe fn free(mem: *mut core::ffi::c_void) {}
543+
/// # }
543544
///
544545
/// use std::mem;
545546
///
@@ -548,7 +549,7 @@ impl () {}
548549
/// if my_num.is_null() {
549550
/// panic!("failed to allocate memory");
550551
/// }
551-
/// libc::free(my_num as *mut libc::c_void);
552+
/// libc::free(my_num as *mut core::ffi::c_void);
552553
/// }
553554
/// ```
554555
///

tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#![crate_type = "staticlib"]
22
#![feature(c_variadic)]
3-
#![feature(rustc_private)]
43

5-
extern crate libc;
6-
7-
use libc::{c_char, c_double, c_int, c_long, c_longlong};
4+
use std::ffi::{c_char, c_double, c_int, c_long, c_longlong};
85
use std::ffi::VaList;
96
use std::ffi::{CString, CStr};
107

tests/run-make/link-path-order/main.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
#![feature(rustc_private)]
2-
3-
extern crate libc;
1+
use std::ffi::c_int;
42

53
#[link(name = "foo", kind = "static")]
64
extern "C" {
7-
fn should_return_one() -> libc::c_int;
5+
fn should_return_one() -> c_int;
86
}
97

108
fn main() {

tests/ui-fulldeps/regions-mock-tcx.rs

-138
This file was deleted.

tests/ui/env-null-vars.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1+
// Ensure that env::vars() does not panic if environ is null.
2+
// Regression test for rust-lang/rust#53200
13
//@ run-pass
24

3-
#![allow(unused_imports)]
4-
5-
//@ ignore-windows
6-
7-
// issue-53200
8-
95
#![feature(rustc_private)]
10-
extern crate libc;
11-
12-
use std::env;
136

147
// FIXME: more platforms?
158
#[cfg(target_os = "linux")]
169
fn main() {
10+
extern crate libc;
1711
unsafe { libc::clearenv(); }
18-
assert_eq!(env::vars().count(), 0);
12+
assert_eq!(std::env::vars().count(), 0);
1913
}
2014

2115
#[cfg(not(target_os = "linux"))]

tests/ui/runtime/out-of-stack.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,16 @@
88
//@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
99
//@ ignore-nto no stack overflow handler used (no alternate stack available)
1010

11-
#![feature(core_intrinsics)]
1211
#![feature(rustc_private)]
1312

1413
#[cfg(unix)]
1514
extern crate libc;
1615

1716
use std::env;
17+
use std::hint::black_box;
1818
use std::process::Command;
1919
use std::thread;
2020

21-
// Inlining to avoid llvm turning the recursive functions into tail calls,
22-
// which doesn't consume stack.
23-
#[inline(always)]
24-
pub fn black_box<T>(dummy: T) { std::intrinsics::black_box(dummy); }
25-
2621
fn silent_recurse() {
2722
let buf = [0u8; 1000];
2823
black_box(buf);

tests/ui/sanitizer/thread.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
//@ error-pattern: Location is heap block of size 4
2121
//@ error-pattern: allocated by main thread
2222

23-
#![feature(raw_ref_op)]
2423
#![feature(rustc_private)]
2524
extern crate libc;
2625

0 commit comments

Comments
 (0)