Skip to content

Commit 4ce7acc

Browse files
committed
Auto merge of #38949 - GuillaumeGomez:fix_linker, r=nagisa
Fix linker failure on windows Fixes #38933. r? @ollie27
2 parents c2b19c1 + 6f58b7f commit 4ce7acc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_driver/driver.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ use std::mem;
4646
use std::ffi::{OsString, OsStr};
4747
use std::fs;
4848
use std::io::{self, Write};
49+
use std::iter;
4950
use std::path::{Path, PathBuf};
5051
use syntax::{ast, diagnostics, visit};
5152
use syntax::attr;
@@ -667,7 +668,10 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
667668
new_path.push(path);
668669
}
669670
}
670-
env::set_var("PATH", &env::join_paths(new_path).unwrap());
671+
env::set_var("PATH",
672+
&env::join_paths(new_path.iter()
673+
.filter(|p| env::join_paths(iter::once(p)).is_ok()))
674+
.unwrap());
671675
}
672676
let features = sess.features.borrow();
673677
let cfg = syntax::ext::expand::ExpansionConfig {

0 commit comments

Comments
 (0)