@@ -118,22 +118,23 @@ fn miri_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
118
118
config. comment_defaults . base ( ) . add_custom ( "edition" , Edition ( "2021" . into ( ) ) ) ;
119
119
120
120
if with_dependencies {
121
- // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
122
- // (It's a separate crate, so we don't get an env var from cargo.)
123
- let mut program = CommandBuilder :: cargo ( ) ;
124
- program. program = {
125
- let mut prog = miri_path ( ) ;
126
- prog. set_file_name ( format ! ( "cargo-miri{}" , env:: consts:: EXE_SUFFIX ) ) ;
127
- prog
128
- } ;
129
- let builder_args = [ "miri" , "run" ] ; // There is no `cargo miri build` so we just use `cargo miri run`.
130
- program. args = builder_args. into_iter ( ) . map ( Into :: into) . collect ( ) ;
131
- let crate_manifest_path = Path :: new ( "test_dependencies" ) . join ( "Cargo.toml" ) ;
132
- // Reset `RUSTFLAGS` to work around <https://github.com/rust-lang/rust/pull/119574#issuecomment-1876878344>.
133
- program. envs . push ( ( "RUSTFLAGS" . into ( ) , None ) ) ;
134
121
config. comment_defaults . base ( ) . set_custom (
135
122
"dependencies" ,
136
- DependencyBuilder { program, crate_manifest_path, build_std : None } ,
123
+ DependencyBuilder {
124
+ program : CommandBuilder {
125
+ // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
126
+ // (It's a separate crate, so we don't get an env var from cargo.)
127
+ program : miri_path ( )
128
+ . with_file_name ( format ! ( "cargo-miri{}" , env:: consts:: EXE_SUFFIX ) ) ,
129
+ // There is no `cargo miri build` so we just use `cargo miri run`.
130
+ args : [ "miri" , "run" ] . into_iter ( ) . map ( Into :: into) . collect ( ) ,
131
+ // Reset `RUSTFLAGS` to work around <https://github.com/rust-lang/rust/pull/119574#issuecomment-1876878344>.
132
+ envs : vec ! [ ( "RUSTFLAGS" . into( ) , None ) ] ,
133
+ ..CommandBuilder :: cargo ( )
134
+ } ,
135
+ crate_manifest_path : Path :: new ( "test_dependencies" ) . join ( "Cargo.toml" ) ,
136
+ build_std : None ,
137
+ } ,
137
138
) ;
138
139
}
139
140
config
0 commit comments