Skip to content

Commit 00fd87e

Browse files
authored
Rollup merge of #94645 - RalfJung:available-parallelism-miri, r=the8472
do not attempt to open cgroup files under Miri Since #92697, `cargo miri test` always fails under default flags, and one would have to use `MIRIFLAGS=-Zmiri-disable-isolation cargo miri test` instead. This PR fixes that problem. Cc `@the8472` `@joshtriplett`
2 parents 49d20c4 + 51b4ea2 commit 00fd87e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/std/src/sys/unix/thread.rs

+5
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,11 @@ fn cgroup2_quota() -> usize {
384384
use crate::path::PathBuf;
385385

386386
let mut quota = usize::MAX;
387+
if cfg!(miri) {
388+
// Attempting to open a file fails under default flags due to isolation.
389+
// And Miri does not have parallelism anyway.
390+
return quota;
391+
}
387392

388393
let _: Option<()> = try {
389394
let mut buf = Vec::with_capacity(128);

0 commit comments

Comments
 (0)