File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -305,9 +305,10 @@ impl Step for Cargo {
305305 // those features won't be able to land.
306306 cargo. env ( "CARGO_TEST_DISABLE_NIGHTLY" , "1" ) ;
307307 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 ) ) ;
308+ // Cargo's test suite uses `CARGO_RUSTC_CURRENT_DIR` to determine the path that `file!` is
309+ // relative to. Cargo no longer sets this env var, so we have to do that. This has to be the
310+ // same value as `-Zroot-dir`.
311+ cargo. env ( "CARGO_RUSTC_CURRENT_DIR" , builder. src . display ( ) . to_string ( ) ) ;
311312
312313 #[ cfg( feature = "build-metrics" ) ]
313314 builder. metrics . begin_test_suite (
You can’t perform that action at this time.
0 commit comments