Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #16899 - Veykril:discover-fix, r=Veykril
fix: Fix project discovery not checking whether the `Cargo.toml` actually exists Got dropped in https://github.com/rust-lang/rust-analyzer/pull/16889, somehow r-a's codebase itself doesn't even run into this so I didn't see it when testing ...
bors 2024-03-20
parent 6fce1d7 · parent c7f0201 · commit 5e276ae
-rw-r--r--crates/project-model/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/project-model/src/lib.rs b/crates/project-model/src/lib.rs
index 51bb4fe303..28696aa327 100644
--- a/crates/project-model/src/lib.rs
+++ b/crates/project-model/src/lib.rs
@@ -126,6 +126,7 @@ impl ProjectManifest {
entities
.filter_map(Result::ok)
.map(|it| it.path().join("Cargo.toml"))
+ .filter(|it| it.exists())
.map(AbsPathBuf::try_from)
.filter_map(|it| it.ok()?.try_into().ok())
.collect()