Skip to content

Commit 46c5b55

Browse files
author
Jonas Schievink
committed
Log failure to load crate root file
1 parent bd8ba80 commit 46c5b55

File tree

1 file changed

+7
-1
lines changed
  • crates/project_model/src

1 file changed

+7
-1
lines changed

crates/project_model/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,13 @@ impl ProjectWorkspace {
308308
.crates()
309309
.filter_map(|(crate_id, krate)| {
310310
let file_path = &krate.root_module;
311-
let file_id = load(&file_path)?;
311+
let file_id = match load(&file_path) {
312+
Some(id) => id,
313+
None => {
314+
log::error!("failed to load crate root {}", file_path.display());
315+
return None;
316+
}
317+
};
312318

313319
let env = krate.env.clone().into_iter().collect();
314320
let proc_macro = krate

0 commit comments

Comments
 (0)