Skip to content

Commit 0eefa94

Browse files
committed
Auto merge of rust-lang#123506 - RalfJung:miri-test-libstd, r=Mark-Simulacrum
check-aux: test core, alloc, std in Miri Let's see if this works, and how long it takes.
2 parents 587f7c3 + bbac745 commit 0eefa94

File tree

7 files changed

+13
-2
lines changed

7 files changed

+13
-2
lines changed

alloc/benches/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Disabling on android for the time being
22
// See https://github.com/rust-lang/rust/issues/73535#event-3477699747
33
#![cfg(not(target_os = "android"))]
4+
// Disabling in Miri as these would take too long.
5+
#![cfg(not(miri))]
46
#![feature(btree_extract_if)]
57
#![feature(iter_next_chunk)]
68
#![feature(repr_simd)]

alloc/src/sync.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,9 @@ impl<T, A: Allocator> Arc<T, A> {
10621062
///
10631063
/// // Create a long list and clone it
10641064
/// let mut x = LinkedList::new();
1065-
/// for i in 0..100000 {
1065+
/// let size = 100000;
1066+
/// # let size = if cfg!(miri) { 100 } else { size };
1067+
/// for i in 0..size {
10661068
/// x.push(i); // Adds i to the front of x
10671069
/// }
10681070
/// let y = x.clone();

core/benches/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// wasm32 does not support benches (no time).
22
#![cfg(not(target_arch = "wasm32"))]
3+
// Disabling in Miri as these would take too long.
4+
#![cfg(not(miri))]
35
#![feature(flt2dec)]
46
#![feature(test)]
57
#![feature(trusted_random_access)]

std/benches/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Disabling in Miri as these would take too long.
2+
#![cfg(not(miri))]
13
#![feature(test)]
24

35
extern crate test;

std/tests/process_spawning.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::str;
88
mod common;
99

1010
#[test]
11+
#[cfg_attr(miri, ignore)] // Process spawning not supported by Miri
1112
fn issue_15149() {
1213
// If we're the parent, copy our own binary to a new directory.
1314
let my_path = env::current_exe().unwrap();

std/tests/switch-stdout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ fn switch_stdout_to(file: OwnedHandle) -> OwnedHandle {
5151
}
5252

5353
#[test]
54+
#[cfg_attr(miri, ignore)] // dup/SetStdHandle not supported by Miri
5455
fn switch_stdout() {
5556
let temp = common::tmpdir();
5657
let path = temp.join("switch-stdout-output");

std/tests/thread.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use std::time::Duration;
55

66
#[test]
77
#[cfg_attr(target_os = "emscripten", ignore)]
8-
fn sleep() {
8+
#[cfg_attr(miri, ignore)] // Miri does not like the thread leak
9+
fn sleep_very_long() {
910
let finished = Arc::new(Mutex::new(false));
1011
let t_finished = finished.clone();
1112
thread::spawn(move || {

0 commit comments

Comments
 (0)