We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c2b19c1 + 6f58b7f commit 4ce7accCopy full SHA for 4ce7acc
src/librustc_driver/driver.rs
@@ -46,6 +46,7 @@ use std::mem;
46
use std::ffi::{OsString, OsStr};
47
use std::fs;
48
use std::io::{self, Write};
49
+use std::iter;
50
use std::path::{Path, PathBuf};
51
use syntax::{ast, diagnostics, visit};
52
use syntax::attr;
@@ -667,7 +668,10 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
667
668
new_path.push(path);
669
}
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());
675
676
let features = sess.features.borrow();
677
let cfg = syntax::ext::expand::ExpansionConfig {
0 commit comments