File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,18 @@ impl Rustc {
4747 let _p = profile:: start ( "Rustc::new" ) ;
4848
4949 // 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.
5153 let mut cmd = ProcessBuilder :: new ( & path) ;
5254 cmd. arg ( "--print=rustc-path" ) ;
5355 if let Ok ( output) = cmd. output ( ) {
5456 if output. status . success ( ) {
5557 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+ }
5762 }
5863 }
5964 }
You can’t perform that action at this time.
0 commit comments