Skip to content

Commit

Permalink
Fix miri by ensuring that core and alloc don't get tested directly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bjorn3 committed Feb 26, 2025
1 parent 9ff085c commit 7d547bf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2786,12 +2786,15 @@ impl Step for Crate {
};

let mut crates = self.crates.clone();
// The core crate can't directly be tested. We could silently
// ignore it, but replacing it with it's own test crate is less
// confusing for users.
// The core and alloc crates can't directly be tested. We could
// silently ignore them, but replacing them with their test crate
// is less confusing for users.
if crates.iter().any(|crate_| crate_ == "core") {
crates.push("coretests".to_owned());
}
if crates.iter().any(|crate_| crate_ == "alloc") {
crates.push("alloctests".to_owned());
}

run_cargo_test(cargo, &[], &crates, &*crate_description(&self.crates), target, builder);
}
Expand Down

0 comments on commit 7d547bf

Please sign in to comment.