Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/project_model/src/sysroot.rs')
-rw-r--r--crates/project_model/src/sysroot.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/project_model/src/sysroot.rs b/crates/project_model/src/sysroot.rs
index 153cbc1c84..a7a7cb6da0 100644
--- a/crates/project_model/src/sysroot.rs
+++ b/crates/project_model/src/sysroot.rs
@@ -188,13 +188,13 @@ fn get_rustc_src(sysroot_path: &AbsPath) -> Option<ManifestPath> {
}
fn get_rust_src(sysroot_path: &AbsPath) -> Option<AbsPathBuf> {
- // Try the new path first since the old one still exists.
- let rust_src = sysroot_path.join("lib/rustlib/src/rust");
- tracing::debug!(
- "Checking sysroot (looking for `library` and `src` dirs): {}",
- rust_src.display()
- );
- ["library", "src"].iter().map(|it| rust_src.join(it)).find(|it| fs::metadata(it).is_ok())
+ let rust_src = sysroot_path.join("lib/rustlib/src/rust/library");
+ tracing::debug!("Checking sysroot: {}", rust_src.display());
+ if fs::metadata(&rust_src).is_ok() {
+ Some(rust_src)
+ } else {
+ None
+ }
}
const SYSROOT_CRATES: &str = "