Skip to content

Commit 94eeebb

Browse files
kristoff3rmockersf
authored andcommitted
Fix compilation of compile_fail_utils when not using rustup (#18394)
# Objective Currently the `compile_fail_utils` crate fails to compile (ironic) when the `RUSTUP_HOME` env var isn't set. This has been the case for a long time, but I only noticed it recently due to rust-analyzer starting to show the error. ## Solution Only filter the logs for the `RUSTUP_HOME` variable if it's set.
1 parent d0c92de commit 94eeebb

File tree

1 file changed

+3
-1
lines changed
  • tools/compile_fail_utils/src

1 file changed

+3
-1
lines changed

tools/compile_fail_utils/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ fn basic_config(root_dir: impl Into<PathBuf>, args: &Args) -> ui_test::Result<Co
5959

6060
// Don't leak contributor filesystem paths
6161
config.path_stderr_filter(Path::new(bevy_root), b"$BEVY_ROOT");
62-
config.path_stderr_filter(Path::new(env!("RUSTUP_HOME")), b"$RUSTUP_HOME");
62+
if let Some(path) = option_env!("RUSTUP_HOME") {
63+
config.path_stderr_filter(Path::new(path), b"$RUSTUP_HOME");
64+
}
6365

6466
// ui_test doesn't compile regex with perl character classes.
6567
// \pL = unicode class for letters, \pN = unicode class for numbers

0 commit comments

Comments
 (0)