diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 2c1561ea056..10b29deefad 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -118,22 +118,23 @@ fn miri_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) -> config.comment_defaults.base().add_custom("edition", Edition("2021".into())); if with_dependencies { - // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary. - // (It's a separate crate, so we don't get an env var from cargo.) - let mut program = CommandBuilder::cargo(); - program.program = { - let mut prog = miri_path(); - prog.set_file_name(format!("cargo-miri{}", env::consts::EXE_SUFFIX)); - prog - }; - let builder_args = ["miri", "run"]; // There is no `cargo miri build` so we just use `cargo miri run`. - program.args = builder_args.into_iter().map(Into::into).collect(); - let crate_manifest_path = Path::new("test_dependencies").join("Cargo.toml"); - // Reset `RUSTFLAGS` to work around . - program.envs.push(("RUSTFLAGS".into(), None)); config.comment_defaults.base().set_custom( "dependencies", - DependencyBuilder { program, crate_manifest_path, build_std: None }, + DependencyBuilder { + program: CommandBuilder { + // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary. + // (It's a separate crate, so we don't get an env var from cargo.) + program: miri_path() + .with_file_name(format!("cargo-miri{}", env::consts::EXE_SUFFIX)), + // There is no `cargo miri build` so we just use `cargo miri run`. + args: ["miri", "run"].into_iter().map(Into::into).collect(), + // Reset `RUSTFLAGS` to work around . + envs: vec![("RUSTFLAGS".into(), None)], + ..CommandBuilder::cargo() + }, + crate_manifest_path: Path::new("test_dependencies").join("Cargo.toml"), + build_std: None, + }, ); } config