Skip to content

Commit 852f472

Browse files
committed
MIRI_REPLACE_LIBRS_IF_NOT_TEST: also apply to crates.io crates
1 parent f7feabc commit 852f472

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/tools/miri/cargo-miri/src/phases.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,10 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
454454
continue;
455455
}
456456
// If the REPLACE_LIBRS hack is enabled and we are building a `lib.rs` file, and a
457-
// `lib.miri.rs` file exists, then build that instead. We only consider relative paths
458-
// as cargo uses those for files in the workspace; dependencies from crates.io get
459-
// absolute paths.
457+
// `lib.miri.rs` file exists, then build that instead.
460458
if replace_librs {
461459
let path = Path::new(&arg);
462-
if path.is_relative()
463-
&& path.file_name().is_some_and(|f| f == "lib.rs")
464-
&& path.is_file()
465-
{
460+
if path.file_name().is_some_and(|f| f == "lib.rs") && path.is_file() {
466461
let miri_rs = Path::new(&arg).with_extension("miri.rs");
467462
if miri_rs.is_file() {
468463
if verbose > 0 {

0 commit comments

Comments
 (0)