File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,14 @@ fn can_compile<T: AsRef<str>>(test: T) -> bool {
50
50
let rustc = var ( "RUSTC" ) . unwrap ( ) ;
51
51
let target = var ( "TARGET" ) . unwrap ( ) ;
52
52
53
- let mut cmd = if let Ok ( wrapper) = var ( "RUSTC_WRAPPER" ) {
53
+ // Use `RUSTC_WRAPPER` if it's set, unless it's set to an empty string,
54
+ // as documented [here].
55
+ // [here]: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-reads
56
+ let wrapper = var ( "RUSTC_WRAPPER" )
57
+ . ok ( )
58
+ . and_then ( |w| if w. is_empty ( ) { None } else { Some ( w) } ) ;
59
+
60
+ let mut cmd = if let Some ( wrapper) = wrapper {
54
61
let mut cmd = std:: process:: Command :: new ( wrapper) ;
55
62
// The wrapper's first argument is supposed to be the path to rustc.
56
63
cmd. arg ( rustc) ;
You can’t perform that action at this time.
0 commit comments