Skip to content

Commit 08fd164

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 c0ee8f5 commit 08fd164

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/test/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -838,11 +838,9 @@ fn handle_result(
838838

839839
// Ignore LF and CRLF difference for Windows.
840840
if !string_eq_ignore_newline_repr(&fmt_text, &text) {
841-
if let Some(bless) = std::env::var_os("BLESS") {
842-
if bless != "0" {
843-
std::fs::write(file_name, fmt_text).unwrap();
844-
continue;
845-
}
841+
if std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0") {
842+
std::fs::write(file_name, fmt_text).unwrap();
843+
continue;
846844
}
847845
let diff = make_diff(&text, &fmt_text, DIFF_CONTEXT_SIZE);
848846
assert!(

0 commit comments

Comments
 (0)