Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b9aad98

Browse files
committed
Auto merge of rust-lang#2420 - RalfJung:num_cpus, r=RalfJung
move num_cpus test from test-cargo-miri to crate test
2 parents 963f08b + 34922be commit b9aad98

File tree

7 files changed

+14
-30
lines changed

7 files changed

+14
-30
lines changed

test-cargo-miri/Cargo.lock

Lines changed: 1 addition & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-cargo-miri/subcrate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ path = "test.rs"
1818
harness = false
1919

2020
[dev-dependencies]
21-
num_cpus = "1.10.1"
21+
byteorder = "1.0"

test-cargo-miri/subcrate/test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::env;
22

3+
use byteorder::{ByteOrder, LittleEndian};
4+
35
fn main() {
46
println!("subcrate testing");
57

@@ -11,6 +13,6 @@ fn main() {
1113
let crate_dir = crate_dir.to_string_lossy().replace("\\", "/");
1214
assert_eq!(env_dir, crate_dir);
1315

14-
// Make sure we can call `num_cpus`.
15-
num_cpus::get();
16+
// Make sure we can call dev-dependencies.
17+
let _n = <LittleEndian as ByteOrder>::read_u32(&[1, 2, 3, 4]);
1618
}

test_dependencies/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test_dependencies/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ edition = "2021"
1212
tokio = { version = "1.0", features = ["full"] }
1313
libc = "0.2"
1414
page_size = "0.4.1"
15+
num_cpus = "1.10.1"
1516

1617
getrandom_1 = { package = "getrandom", version = "0.1" }
1718
getrandom_2 = { package = "getrandom", version = "0.2" }

tests/pass/crates/num_cpus.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@compile-flags: -Zmiri-disable-isolation
2+
3+
fn main() {
4+
assert_eq!(num_cpus::get(), 1);
5+
}

tests/pass/crates/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use rand::{rngs::SmallRng, Rng, SeedableRng};
21
// mac-os `getrandom_1` does some pointer shenanigans
32
//@compile-flags: -Zmiri-permissive-provenance
3+
use rand::{rngs::SmallRng, Rng, SeedableRng};
44

55
fn main() {
66
// Test `getrandom` directly (in multiple different versions).

0 commit comments

Comments
 (0)