Skip to content

Commit

Permalink
Auto merge of rust-lang#3457 - RalfJung:replace-librs, r=RalfJung
Browse files Browse the repository at this point in the history
MIRI_REPLACE_LIBRS_IF_NOT_TEST: also apply to crates.io crates

This is needed to make rust-lang/compiler-builtins#586 work.
  • Loading branch information
bors committed Apr 10, 2024
2 parents f7feabc + 852f472 commit 788a1db
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/tools/miri/cargo-miri/src/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,10 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
continue;
}
// If the REPLACE_LIBRS hack is enabled and we are building a `lib.rs` file, and a
// `lib.miri.rs` file exists, then build that instead. We only consider relative paths
// as cargo uses those for files in the workspace; dependencies from crates.io get
// absolute paths.
// `lib.miri.rs` file exists, then build that instead.
if replace_librs {
let path = Path::new(&arg);
if path.is_relative()
&& path.file_name().is_some_and(|f| f == "lib.rs")
&& path.is_file()
{
if path.file_name().is_some_and(|f| f == "lib.rs") && path.is_file() {
let miri_rs = Path::new(&arg).with_extension("miri.rs");
if miri_rs.is_file() {
if verbose > 0 {
Expand Down

0 comments on commit 788a1db

Please sign in to comment.