Skip to content

Commit 9c88f10

Browse files
committed
Fix miri by ensuring that core and alloc don't get tested directly
cargo test -p core -p alloc overrides the test=false in Cargo.toml so we have to avoid passing -p core and -p alloc to cargo test.
1 parent 44c07ff commit 9c88f10

File tree

1 file changed

+19
-1
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+19
-1
lines changed

src/bootstrap/src/core/build_steps/test.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -2783,10 +2783,28 @@ impl Step for Crate {
27832783
_ => panic!("can only test libraries"),
27842784
};
27852785

2786+
let crates = self
2787+
.crates
2788+
.iter()
2789+
.cloned()
2790+
.map(|crate_| {
2791+
// The core and alloc crates can't directly be tested. We could
2792+
// silently ignore them, but replacing them with their test crate
2793+
// is less confusing for users.
2794+
if crate_ == "core" {
2795+
"coretests".to_owned()
2796+
} else if crate_ == "alloc" {
2797+
"alloctests".to_owned()
2798+
} else {
2799+
crate_
2800+
}
2801+
})
2802+
.collect::<Vec<_>>();
2803+
27862804
run_cargo_test(
27872805
cargo,
27882806
&[],
2789-
&self.crates,
2807+
&crates,
27902808
&self.crates[0],
27912809
&*crate_description(&self.crates),
27922810
target,

0 commit comments

Comments
 (0)