aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model/src/sysroot.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_project_model/src/sysroot.rs')
-rw-r--r--crates/ra_project_model/src/sysroot.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs
index 55ff5ad80..8d68032b2 100644
--- a/crates/ra_project_model/src/sysroot.rs
+++ b/crates/ra_project_model/src/sysroot.rs
@@ -1,5 +1,6 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use super::find_executables::get_path_for_executable;
3use anyhow::{bail, Context, Result}; 4use anyhow::{bail, Context, Result};
4use std::{ 5use std::{
5 env, ops, 6 env, ops,
@@ -114,7 +115,8 @@ fn get_or_install_rust_src(cargo_toml: &Path) -> Result<PathBuf> {
114 if let Ok(path) = env::var("RUST_SRC_PATH") { 115 if let Ok(path) = env::var("RUST_SRC_PATH") {
115 return Ok(path.into()); 116 return Ok(path.into());
116 } 117 }
117 let rustc_output = run_command_in_cargo_dir(cargo_toml, "rustc", &["--print", "sysroot"])?; 118 let rustc = get_path_for_executable("rustc")?;
119 let rustc_output = run_command_in_cargo_dir(cargo_toml, &rustc, &["--print", "sysroot"])?;
118 let stdout = String::from_utf8(rustc_output.stdout)?; 120 let stdout = String::from_utf8(rustc_output.stdout)?;
119 let sysroot_path = Path::new(stdout.trim()); 121 let sysroot_path = Path::new(stdout.trim());
120 let src_path = sysroot_path.join("lib/rustlib/src/rust/src"); 122 let src_path = sysroot_path.join("lib/rustlib/src/rust/src");