Skip to content

Commit 2cdfc1e

Browse files
bors[bot]RalfJung
andauthored
Merge #184
184: Miri has gained some more features r=matklad a=RalfJung Barriers, concurrency, and spinloops should all work now. Co-authored-by: Ralf Jung <post@ralfj.de>
2 parents 485aaa8 + b7839ed commit 2cdfc1e

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/imp_std.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ mod tests {
281281
}
282282

283283
#[test]
284-
#[cfg(not(miri))]
285284
fn stampede_once() {
286285
static O: OnceCell<()> = OnceCell::new();
287286
static mut RUN: bool = false;

tests/it.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,10 @@ mod sync {
331331
}
332332

333333
#[test]
334-
#[cfg_attr(miri, ignore)] // miri doesn't support Barrier
335334
fn get_or_init_stress() {
336335
use std::sync::Barrier;
337-
let n_threads = 1_000;
338-
let n_cells = 1_000;
336+
let n_threads = if cfg!(miri) { 30 } else { 1_000 };
337+
let n_cells = if cfg!(miri) { 30 } else { 1_000 };
339338
let cells: Vec<_> = std::iter::repeat_with(|| (Barrier::new(n_threads), OnceCell::new()))
340339
.take(n_cells)
341340
.collect();
@@ -577,9 +576,8 @@ mod sync {
577576
}
578577

579578
#[test]
580-
#[cfg_attr(miri, ignore)] // FIXME: deadlocks, likely caused by https://github.com/rust-lang/miri/issues/1388
581579
fn once_cell_does_not_leak_partially_constructed_boxes() {
582-
let n_tries = 100;
580+
let n_tries = if cfg!(miri) { 10 } else { 100 };
583581
let n_readers = 10;
584582
let n_writers = 3;
585583
const MSG: &str = "Hello, World";
@@ -604,7 +602,6 @@ mod sync {
604602
}
605603

606604
#[test]
607-
#[cfg_attr(miri, ignore)] // miri doesn't support Barrier
608605
fn get_does_not_block() {
609606
use std::sync::Barrier;
610607

0 commit comments

Comments
 (0)