Skip to content

Commit 85b500c

Browse files
committed
Auto merge of #10899 - ehuss:empty-wrapper-test, r=weihanglo
Make the empty rustc-wrapper test more explicit. This changes the test for an empty RUSTC_WRAPPER environment variable to make it explicit that it doesn't just ignore the environment variable, but that it also essentially unsets any config-loaded value. It's not clear if this implication was known at the time it was added in #5985, but I don't think we can change it, and it can be useful.
2 parents 27f4f02 + 8a487ab commit 85b500c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/testsuite/check.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,18 @@ fn check_keep_going() {
870870

871871
#[cargo_test]
872872
fn does_not_use_empty_rustc_wrapper() {
873-
let p = project().file("src/lib.rs", "").build();
873+
// An empty RUSTC_WRAPPER environment variable won't be used.
874+
// The env var will also override the config, essentially unsetting it.
875+
let p = project()
876+
.file("src/lib.rs", "")
877+
.file(
878+
".cargo/config.toml",
879+
r#"
880+
[build]
881+
rustc-wrapper = "do-not-execute-me"
882+
"#,
883+
)
884+
.build();
874885
p.cargo("check").env("RUSTC_WRAPPER", "").run();
875886
}
876887

0 commit comments

Comments
 (0)