@@ -430,10 +430,6 @@ impl Step for Rustfmt {
430430 & [ ] ,
431431 ) ;
432432
433- if builder. config . cmd . bless ( ) {
434- cargo. env ( "BLESS" , "1" ) ;
435- }
436-
437433 let dir = testdir ( builder, compiler. host ) ;
438434 t ! ( fs:: create_dir_all( & dir) ) ;
439435 cargo. env ( "RUSTFMT_TEST_DIR" , dir) ;
@@ -633,10 +629,6 @@ impl Step for Miri {
633629 cargo. env ( "MIRI_SYSROOT" , & miri_sysroot) ;
634630 cargo. env ( "MIRI_HOST_SYSROOT" , sysroot) ;
635631 cargo. env ( "MIRI" , & miri) ;
636- // propagate --bless
637- if builder. config . cmd . bless ( ) {
638- cargo. env ( "MIRI_BLESS" , "Gesundheit" ) ;
639- }
640632
641633 // Set the target.
642634 cargo. env ( "MIRI_TEST_TARGET" , target. rustc_target_arg ( ) ) ;
@@ -654,8 +646,8 @@ impl Step for Miri {
654646 cargo. env ( "MIRIFLAGS" , "-O -Zmir-opt-level=4 -Cdebug-assertions=yes" ) ;
655647 // Optimizations can change backtraces
656648 cargo. env ( "MIRI_SKIP_UI_CHECKS" , "1" ) ;
657- // `MIRI_SKIP_UI_CHECKS` and `MIRI_BLESS ` are incompatible
658- cargo. env_remove ( "MIRI_BLESS " ) ;
649+ // `MIRI_SKIP_UI_CHECKS` and `RUSTC_BLESS ` are incompatible
650+ cargo. env_remove ( "RUSTC_BLESS " ) ;
659651 // Optimizations can change error locations and remove UB so don't run `fail` tests.
660652 cargo. args ( & [ "tests/pass" , "tests/panic" ] ) ;
661653
@@ -799,11 +791,6 @@ impl Step for Clippy {
799791 cargo. add_rustc_lib_path ( builder, compiler) ;
800792 let mut cargo = prepare_cargo_test ( cargo, & [ ] , & [ ] , "clippy" , compiler, host, builder) ;
801793
802- // propagate --bless
803- if builder. config . cmd . bless ( ) {
804- cargo. env ( "BLESS" , "Gesundheit" ) ;
805- }
806-
807794 let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
808795
809796 #[ allow( deprecated) ] // Clippy reports errors if it blessed the outputs
@@ -2245,9 +2232,11 @@ fn prepare_cargo_test(
22452232) -> Command {
22462233 let mut cargo = cargo. into ( ) ;
22472234
2248- // If bless is passed, give downstream crates a way to use it
2249- if builder. config . cmd . bless ( ) {
2250- cargo. env ( "RUSTC_BLESS" , "1" ) ;
2235+ // Propegate `--bless` if it has not already been set/unset
2236+ // Any tools that want to use this should bless if `RUSTC_BLESS` is set to
2237+ // anything other than `0`.
2238+ if builder. config . cmd . bless ( ) && !cargo. get_envs ( ) . any ( |v| v. 0 == "RUSTC_BLESS" ) {
2239+ cargo. env ( "RUSTC_BLESS" , "Gesundheit" ) ;
22512240 }
22522241
22532242 // Pass in some standard flags then iterate over the graph we've discovered
0 commit comments