Skip to content

Commit 3e877ff

Browse files
committed
Rust: do not fail on bad Cargo.toml files
1 parent ae19b2f commit 3e877ff

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

rust/extractor/src/rust_analyzer.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ impl RustAnalyzer {
4545
let projects = find_project_manifests(&cfg.inputs).context("loading inputs")?;
4646
for project in projects {
4747
let manifest = project.manifest_path();
48-
let (db, vfs, _macro_server) =
49-
load_workspace_at(manifest.as_ref(), &config, &load_config, &progress)?;
50-
let path: &Path = manifest.parent().as_ref();
51-
workspace.insert(path.to_path_buf(), (vfs, db));
48+
49+
match load_workspace_at(manifest.as_ref(), &config, &load_config, &progress) {
50+
Ok((db, vfs, _macro_server)) => {
51+
let path: &Path = manifest.parent().as_ref();
52+
workspace.insert(path.to_path_buf(), (vfs, db));
53+
}
54+
Err(err) => {
55+
log::error!("failed to load workspace for {}: {}", manifest, err);
56+
}
57+
}
5258
}
5359
Ok(RustAnalyzer { workspace })
5460
}

0 commit comments

Comments
 (0)