@@ -430,10 +430,6 @@ impl Step for Rustfmt {
430
430
& [ ] ,
431
431
) ;
432
432
433
- if builder. config . cmd . bless ( ) {
434
- cargo. env ( "BLESS" , "1" ) ;
435
- }
436
-
437
433
let dir = testdir ( builder, compiler. host ) ;
438
434
t ! ( fs:: create_dir_all( & dir) ) ;
439
435
cargo. env ( "RUSTFMT_TEST_DIR" , dir) ;
@@ -633,10 +629,6 @@ impl Step for Miri {
633
629
cargo. env ( "MIRI_SYSROOT" , & miri_sysroot) ;
634
630
cargo. env ( "MIRI_HOST_SYSROOT" , sysroot) ;
635
631
cargo. env ( "MIRI" , & miri) ;
636
- // propagate --bless
637
- if builder. config . cmd . bless ( ) {
638
- cargo. env ( "MIRI_BLESS" , "Gesundheit" ) ;
639
- }
640
632
641
633
// Set the target.
642
634
cargo. env ( "MIRI_TEST_TARGET" , target. rustc_target_arg ( ) ) ;
@@ -654,8 +646,8 @@ impl Step for Miri {
654
646
cargo. env ( "MIRIFLAGS" , "-O -Zmir-opt-level=4 -Cdebug-assertions=yes" ) ;
655
647
// Optimizations can change backtraces
656
648
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 " ) ;
659
651
// Optimizations can change error locations and remove UB so don't run `fail` tests.
660
652
cargo. args ( & [ "tests/pass" , "tests/panic" ] ) ;
661
653
@@ -799,11 +791,6 @@ impl Step for Clippy {
799
791
cargo. add_rustc_lib_path ( builder, compiler) ;
800
792
let mut cargo = prepare_cargo_test ( cargo, & [ ] , & [ ] , "clippy" , compiler, host, builder) ;
801
793
802
- // propagate --bless
803
- if builder. config . cmd . bless ( ) {
804
- cargo. env ( "BLESS" , "Gesundheit" ) ;
805
- }
806
-
807
794
let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
808
795
809
796
#[ allow( deprecated) ] // Clippy reports errors if it blessed the outputs
@@ -2245,9 +2232,11 @@ fn prepare_cargo_test(
2245
2232
) -> Command {
2246
2233
let mut cargo = cargo. into ( ) ;
2247
2234
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" ) ;
2251
2240
}
2252
2241
2253
2242
// Pass in some standard flags then iterate over the graph we've discovered
0 commit comments