@@ -13,7 +13,7 @@ use ui_test::custom_flags::edition::Edition;
1313use ui_test:: dependencies:: DependencyBuilder ;
1414use ui_test:: per_test_config:: TestConfig ;
1515use ui_test:: spanned:: Spanned ;
16- use ui_test:: { CommandBuilder , Config , Format , Match , OutputConflictHandling , status_emitter} ;
16+ use ui_test:: { CommandBuilder , Config , Format , Match , ignore_output_conflict , status_emitter} ;
1717
1818#[ derive( Copy , Clone , Debug ) ]
1919enum Mode {
@@ -82,7 +82,9 @@ fn build_native_lib() -> PathBuf {
8282 native_lib_path
8383}
8484
85- struct WithDependencies { }
85+ struct WithDependencies {
86+ bless : bool ,
87+ }
8688
8789/// Does *not* set any args or env vars, since it is shared between the test runner and
8890/// run_dep_mode.
@@ -126,7 +128,7 @@ fn miri_config(
126128 // keep in sync with `./miri run`
127129 config. comment_defaults . base ( ) . add_custom ( "edition" , Edition ( "2021" . into ( ) ) ) ;
128130
129- if let Some ( WithDependencies { } ) = with_dependencies {
131+ if let Some ( WithDependencies { bless } ) = with_dependencies {
130132 config. comment_defaults . base ( ) . set_custom ( "dependencies" , DependencyBuilder {
131133 program : CommandBuilder {
132134 // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
@@ -141,6 +143,7 @@ fn miri_config(
141143 } ,
142144 crate_manifest_path : Path :: new ( "test_dependencies" ) . join ( "Cargo.toml" ) ,
143145 build_std : None ,
146+ bless_lockfile : bless,
144147 } ) ;
145148 }
146149 config
@@ -157,15 +160,15 @@ fn run_tests(
157160 let mut args = ui_test:: Args :: test ( ) ?;
158161 args. bless |= env:: var_os ( "RUSTC_BLESS" ) . is_some_and ( |v| v != "0" ) ;
159162
160- let with_dependencies = with_dependencies. then_some ( WithDependencies { } ) ;
163+ let with_dependencies = with_dependencies. then_some ( WithDependencies { bless : args . bless } ) ;
161164
162165 let mut config = miri_config ( target, path, mode, with_dependencies) ;
163166 config. with_args ( & args) ;
164167 config. bless_command = Some ( "./miri test --bless" . into ( ) ) ;
165168
166169 if env:: var_os ( "MIRI_SKIP_UI_CHECKS" ) . is_some ( ) {
167170 assert ! ( !args. bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time" ) ;
168- config. output_conflict_handling = OutputConflictHandling :: Ignore ;
171+ config. output_conflict_handling = ignore_output_conflict ;
169172 }
170173
171174 // Add a test env var to do environment communication tests.
@@ -337,7 +340,8 @@ fn main() -> Result<()> {
337340}
338341
339342fn run_dep_mode ( target : String , args : impl Iterator < Item = OsString > ) -> Result < ( ) > {
340- let mut config = miri_config ( & target, "" , Mode :: RunDep , Some ( WithDependencies { } ) ) ;
343+ let mut config =
344+ miri_config ( & target, "" , Mode :: RunDep , Some ( WithDependencies { bless : false } ) ) ;
341345 config. comment_defaults . base ( ) . custom . remove ( "edition" ) ; // `./miri` adds an `--edition` in `args`, so don't set it twice
342346 config. fill_host_and_target ( ) ?;
343347 config. program . args = args. collect ( ) ;
0 commit comments