We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4cab8a commit d05bc03Copy full SHA for d05bc03
src/bootstrap/src/core/build_steps/test.rs
@@ -305,9 +305,9 @@ impl Step for Cargo {
305
// those features won't be able to land.
306
cargo.env("CARGO_TEST_DISABLE_NIGHTLY", "1");
307
cargo.env("PATH", path_for_cargo(builder, compiler));
308
- // Cargo's test suite requires configurations from its own `.cargo/config.toml`.
309
- // Change to the directory so Cargo can read from it.
310
- cargo.current_dir(builder.src.join(Self::CRATE_PATH));
+ // Cargo's test suite uses `CARGO_RUSTC_CURRENT_DIR` to determine the path that `file!` is
+ // relative to. Since we are setting `-Zroot-dir`, they will be relative to that.
+ cargo.env("CARGO_RUSTC_CURRENT_DIR", builder.src.display().to_string());
311
312
#[cfg(feature = "build-metrics")]
313
builder.metrics.begin_test_suite(
0 commit comments