File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,18 @@ impl Rustc {
47
47
let _p = profile:: start ( "Rustc::new" ) ;
48
48
49
49
// In order to avoid calling through rustup multiple times, we first ask
50
- // rustc to give us the "resolved" rustc path, and use that instead.
50
+ // rustc to give us the "resolved" rustc path, and use that instead. If
51
+ // this doesn't give us a path, then we just use the original path such
52
+ // that the following logic can handle any resulting errors normally.
51
53
let mut cmd = ProcessBuilder :: new ( & path) ;
52
54
cmd. arg ( "--print=rustc-path" ) ;
53
55
if let Ok ( output) = cmd. output ( ) {
54
56
if output. status . success ( ) {
55
57
if let Ok ( resolved) = String :: from_utf8 ( output. stdout ) {
56
- path = PathBuf :: from ( resolved. trim ( ) ) ;
58
+ let resolved = PathBuf :: from ( resolved. trim ( ) ) ;
59
+ if resolved. exists ( ) {
60
+ path = resolved;
61
+ }
57
62
}
58
63
}
59
64
}
You can’t perform that action at this time.
0 commit comments