diff options
Diffstat (limited to 'crates/project_model/src/workspace.rs')
-rw-r--r-- | crates/project_model/src/workspace.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs index 84990075f..ef0f3c9e4 100644 --- a/crates/project_model/src/workspace.rs +++ b/crates/project_model/src/workspace.rs | |||
@@ -185,7 +185,7 @@ impl ProjectWorkspace { | |||
185 | 185 | ||
186 | pub fn load_detached_files(detached_files: Vec<AbsPathBuf>) -> Result<ProjectWorkspace> { | 186 | pub fn load_detached_files(detached_files: Vec<AbsPathBuf>) -> Result<ProjectWorkspace> { |
187 | let sysroot = Sysroot::discover( | 187 | let sysroot = Sysroot::discover( |
188 | &detached_files.first().ok_or_else(|| format_err!("No detached files to load"))?, | 188 | detached_files.first().ok_or_else(|| format_err!("No detached files to load"))?, |
189 | )?; | 189 | )?; |
190 | let rustc_cfg = rustc_cfg::get(None, None); | 190 | let rustc_cfg = rustc_cfg::get(None, None); |
191 | Ok(ProjectWorkspace::DetachedFiles { files: detached_files, sysroot, rustc_cfg }) | 191 | Ok(ProjectWorkspace::DetachedFiles { files: detached_files, sysroot, rustc_cfg }) |
@@ -324,7 +324,7 @@ impl ProjectWorkspace { | |||
324 | pub fn collect_build_data_configs(&self, collector: &mut BuildDataCollector) { | 324 | pub fn collect_build_data_configs(&self, collector: &mut BuildDataCollector) { |
325 | match self { | 325 | match self { |
326 | ProjectWorkspace::Cargo { cargo, .. } => { | 326 | ProjectWorkspace::Cargo { cargo, .. } => { |
327 | collector.add_config(&cargo.workspace_root(), cargo.build_data_config().clone()); | 327 | collector.add_config(cargo.workspace_root(), cargo.build_data_config().clone()); |
328 | } | 328 | } |
329 | _ => {} | 329 | _ => {} |
330 | } | 330 | } |
@@ -348,7 +348,7 @@ fn project_json_to_crate_graph( | |||
348 | .crates() | 348 | .crates() |
349 | .filter_map(|(crate_id, krate)| { | 349 | .filter_map(|(crate_id, krate)| { |
350 | let file_path = &krate.root_module; | 350 | let file_path = &krate.root_module; |
351 | let file_id = load(&file_path)?; | 351 | let file_id = load(file_path)?; |
352 | Some((crate_id, krate, file_id)) | 352 | Some((crate_id, krate, file_id)) |
353 | }) | 353 | }) |
354 | .map(|(crate_id, krate, file_id)| { | 354 | .map(|(crate_id, krate, file_id)| { |
@@ -534,7 +534,7 @@ fn detached_files_to_crate_graph( | |||
534 | cfg_options.extend(rustc_cfg); | 534 | cfg_options.extend(rustc_cfg); |
535 | 535 | ||
536 | for detached_file in detached_files { | 536 | for detached_file in detached_files { |
537 | let file_id = match load(&detached_file) { | 537 | let file_id = match load(detached_file) { |
538 | Some(file_id) => file_id, | 538 | Some(file_id) => file_id, |
539 | None => { | 539 | None => { |
540 | log::error!("Failed to load detached file {:?}", detached_file); | 540 | log::error!("Failed to load detached file {:?}", detached_file); |
@@ -602,7 +602,7 @@ fn handle_rustc_crates( | |||
602 | crate_graph, | 602 | crate_graph, |
603 | &rustc_workspace[pkg], | 603 | &rustc_workspace[pkg], |
604 | rustc_build_data_map.and_then(|it| it.get(&rustc_workspace[pkg].id)), | 604 | rustc_build_data_map.and_then(|it| it.get(&rustc_workspace[pkg].id)), |
605 | &cfg_options, | 605 | cfg_options, |
606 | proc_macro_loader, | 606 | proc_macro_loader, |
607 | file_id, | 607 | file_id, |
608 | &rustc_workspace[tgt].name, | 608 | &rustc_workspace[tgt].name, |
@@ -685,7 +685,7 @@ fn add_target_crate_root( | |||
685 | let proc_macro = build_data | 685 | let proc_macro = build_data |
686 | .as_ref() | 686 | .as_ref() |
687 | .and_then(|it| it.proc_macro_dylib_path.as_ref()) | 687 | .and_then(|it| it.proc_macro_dylib_path.as_ref()) |
688 | .map(|it| proc_macro_loader(&it)) | 688 | .map(|it| proc_macro_loader(it)) |
689 | .unwrap_or_default(); | 689 | .unwrap_or_default(); |
690 | 690 | ||
691 | let display_name = CrateDisplayName::from_canonical_name(cargo_name.to_string()); | 691 | let display_name = CrateDisplayName::from_canonical_name(cargo_name.to_string()); |