Skip to content

Commit 6ca6be6

Browse files
committed
Unite bless environment variables under RUSTC_BLESS
Currently, Clippy, Miri, Rustfmt, and rustc all use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Emit `RUSTC_BLESS` within `prepare_cargo_test` so it is always available - Change usage of `MIRI_BLESS` in the Miri subtree to use `RUSTC_BLESS` - Change usage of `BLESS` in the Clippy subtree to `RUSTC_BLESS` - Change usage of `BLESS` in the Rustfmt subtree to `RUSTC_BLESS` - Adjust the blessable test in `rustc_errors` to use this same convention - Update documentation where applicable Any tools that uses `RUSTC_BLESS` should check that it is set to any value other than `"0"`.
1 parent ed2ec81 commit 6ca6be6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/compile-test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ fn base_config(test_dir: &str) -> compiletest::Config {
115115
mode: TestMode::Yolo,
116116
stderr_filters: vec![],
117117
stdout_filters: vec![],
118-
output_conflict_handling: if var_os("BLESS").is_some() || env::args().any(|arg| arg == "--bless") {
118+
// FIXME(tgross35): deduplicate bless env once clippy can update
119+
output_conflict_handling: if var_os("RUSTC_BLESS").is_some_and(|v| v != "0")
120+
|| env::args().any(|arg| arg == "--bless") {
119121
compiletest::OutputConflictHandling::Bless
120122
} else {
121123
compiletest::OutputConflictHandling::Error("cargo test -- -- --bless".into())

0 commit comments

Comments
 (0)